3v4l.org

run code in 200+ PHP versions simultaneously
<?php $argv = ['filename', 3, 1, 100]; echo count(preg_grep('/'.($a=$argv)[1].'/',range($a[2],$a[3]))); echo "\n"; $argv = ['filename', 3, 3, 93]; echo count(preg_grep('/'.($a=$argv)[1].'/',range($a[2],$a[3]))); echo "\n"; $argv = ['filename', 12, -200, 200]; echo count(preg_grep('/'.($a=$argv)[1].'/',range($a[2],$a[3]))); echo "\n"; $argv = ['filename', 123, 1, 3]; echo count(preg_grep('/'.($a=$argv)[1].'/',range($a[2],$a[3]))); echo "\n"; $argv = ['filename', 3, 33, 34]; echo count(preg_grep('/'.($a=$argv)[1].'/',range($a[2],$a[3]))); echo "\n"; $argv = ['filename', 0, -1, 1]; echo count(preg_grep('/'.($a=$argv)[1].'/',range($a[2],$a[3]))); echo "\n"; $argv = ['filename', 127, -12, 27]; echo count(preg_grep('/'.($a=$argv)[1].'/',range($a[2],$a[3]))); echo "\n";
based on jCdfm
Output for 7.0.0 - 7.4.6
19 19 24 0 2 1 0
Output for 5.4.0 - 5.6.38
Parse error: syntax error, unexpected '[' in /in/3BBoO on line 4
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/3BBoO on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/3BBoO on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/3BBoO on line 3
Process exited with code 255.