src/Core_Command.php
private static function find_var( $var_name, $code ) {
		$start = strpos( $code, '$' . $var_name . ' = ' );

		if ( ! $start ) {
			return null;
		}

		$start = $start + strlen( $var_name ) + 3;
		$end   = strpos( $code, ';', $start );

		$value = substr( $code, $start, $end - $start );

		return trim( $value, " '" );
	}
private static function find_var( $var_name, $code ) {
		$start = strpos( $code, '$' . $var_name . ' = ' );

		if ( ! $start ) {
			return null;
		}

		$start = $start + strlen( $var_name ) + 3;
		$end   = strpos( $code, ';', $start );

		$value = substr( $code, $start, $end - $start );

		return trim( $value, " '" );
	}
Searches for the value assigned to variable `$var_name` in PHP code `$code`.

This is equivalent to matching the `\$VAR_NAME = ([^;]+)` regular expression and returning
the first match either as a `string` or as an `integer` (depending if it's surrounded by
quotes or not).

@param string $var_name Variable name to search for.
@param string $code PHP code to search in.

@return int|string|null