3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_GET=array(); $_GET['a'] = '{"a1":"1337a","a2":[[],0,3,4,5]}'; $_GET['b'] = "0.00.0"; $_GET['c'] = array("\031c3", "1"); $_GET['d'] = array(); $v1=0;$v2=0;$v3=0;$v4=0; $a=(array)json_decode(@$_GET['a']); if(is_array($a)){ is_numeric(@$a["a1"])?die("nope"):NULL; if(@$a["a1"]){ ($a["a1"]>1336)?$v1=1:NULL; } if(is_array(@$a["a2"])){ if(count($a["a2"])!==5 OR !is_array($a["a2"][0])) die("nope"); $pos = array_search("ctf", $a["a2"]); $pos===false?die("nope"):NULL; foreach($a["a2"] as $key=>$val){ $val==="ctf"?die("nope"):NULL; } $v2=1; } } if(preg_match("/^([0-9]+\.?[0-9]+)+$/",@$_GET['b'])){ $b=json_decode(@$_GET['b']); if($var = $b === NULL){ ($var===true)?$v3=1:NULL; } } $c=@$_GET['c']; $d=@$_GET['d']; if(@$c[1]){ if(!strcmp($c[1],$d) && $c[1]!==$d){ eregi("3|1|c",$d.$c[0])?die("nope4"):NULL; strpos(($c[0].$d), "31c3")?$v4=1:NULL; } } var_dump($v1, $v2, $v3, $v4); if($v1 && $v2 && $v3 && $v4){ echo 'yes'; }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
nope
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 nope
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: strcmp() expects parameter 2 to be string, array given in /in/vhAW6 on line 33 Fatal error: Uncaught Error: Call to undefined function eregi() in /in/vhAW6:34 Stack trace: #0 {main} thrown in /in/vhAW6 on line 34
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Warning: strcmp() expects parameter 2 to be string, array given in /in/vhAW6 on line 33 Notice: Array to string conversion in /in/vhAW6 on line 34 Deprecated: Function eregi() is deprecated in /in/vhAW6 on line 34 nope4
Output for 5.3.0 - 5.3.29
Warning: strcmp() expects parameter 2 to be string, array given in /in/vhAW6 on line 33 Deprecated: Function eregi() is deprecated in /in/vhAW6 on line 34 nope4
Output for 5.2.0, 5.2.9 - 5.2.17
Notice: Array to string conversion in /in/vhAW6 on line 33 int(1) int(1) int(1) int(0)
Output for 5.2.1 - 5.2.8
Notice: Array to string conversion in /in/vhAW6 on line 33 int(1) int(1) int(0) int(0)
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/vhAW6 on line 8
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/vhAW6 on line 8
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/vhAW6 on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/vhAW6 on line 8

preferences:
308.2 ms | 401 KiB | 464 Q