function foo() { $x = asd(); $x[0] = 'a'; echo $x; echo "\n"; var_dump($x); }
function foo() { $x = asd(); foreach ($x as $k => $v) { echo "unreachable code: {$k} {$v}\n"; } return 1; }
function foo() { $x = asd(); for ($i = 0; $i < 10; ++$i) { echo $i . "\n"; } $x += 2; echo $x; echo "\n"; }
function main() { $time = asd(); $items = array(); if (someclass::yo()) { $items = array_of_one(); } $items[1] = $time; return $items; }
function main() { $time = asd(); $items = array(); if (someclass::yo()) { $items[] = 'ZZZZ'; } $items[] = $time; return $items; }
curl_setopt($tk, CURLOPT_POSTFIELDS, 'grant_type=client_credentials'); curl_setopt($tk, CURLOPT_RETURNTRANSFER, true); $token = json_decode(curl_exec($tk)); curl_close($tk); // use token if (isset($token->token_type) && $token->token_type == 'bearer') { $br = curl_init($api_endpoint); curl_setopt($br, CURLOPT_PROXY, $proxy); curl_setopt($br, CURLOPT_HTTPHEADER, array('Authorization: Bearer ' . $token->access_token)); curl_setopt($br, CURLOPT_RETURNTRANSFER, true); $data = curl_exec($br); curl_close($br); // do_something_here_with($data); return objectToArray(json_decode($data)); } } echo "<pre>"; $a1 = asd("OldSpiceLA", null); print_r($a1); $bandera = 1; while ($bandera > 0) { $a1 = asd(null, $a1['search_metadata']['next_results']); /*$a1=asd(null,"?q=%40OldSpiceLA&include_entities=1&result_type=mixed&max_id=".$max_id);*/ print_r($a1); die; $n++; sleep(30); if ($n == 3) { die; } }
spl_autoload_register(function ($class) { $class = str_replace('PSL', 'Security', $class); require '../' . $class . '.php'; }); function asd() { basd(); } function basd() { asdasd(); } function asdasd() { } asd(); $st = microtime(true); for ($a = 0; $a < 1; $a++) { hash_hmac('sha256', 'asdasd asd asda sds ', 'asdasd asd asda sds ', true); } echo "Took: " . (microtime(true) - $st); exit; /*$a = new mysqli('localhost', 'root', 'hottis'); var_dump($a instanceof mysqli); $a = new PDO('mysql:host=localhost', 'root', 'hottis'); var_dump($a instanceof PDO); $a = mysql_connect('localhost', 'root', 'hottis'); var_dump(get_resource_type($a) === 'mysql link');
function foo($b) { asd($b[]); }
<?php function asd() { $a = 2; $b = 3; $c = $a + $b; $d = $a * $b; return $c; } $d = $c + $a; echo asd(); echo "....", $d;
function asd($x, $y, ...$z) { asd($x, $y, $x + $y, $y + $x, "asd"); }