3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "The 'Wee, inline callables are sort of function things' "; class q {function foo($str) {return 'moo '.$str; } } var_dump(([new q, 'foo'])('cow')); echo "The 'Wow, we can just quote anything now'"; function bar( ) { return 'cow'; } var_dump('bar'( )); echo "The 'I'm amazed PHP doesn't mess this up' "; foreach ($Array = [[12 => 'Moo'], [13 => 'Cow']] as $Array) { var_dump($Array); } echo "The 'PHP Variables MUST NOT contain some symbols... for very soft values of MUST NOT' "; ${'$0a'} = 12; ${'0a'} = 13; var_dump(${'$0a'}); var_dump(${'0a'}); // $0a is invalid and $$0a is even more invalid, with spinkles echo "The 'Good luck and thanks for all the cows' "; @var_dump(0x2&${$Array=['cow'=>3]}['cow']); echo "The 'Hurrah BC breaks, if your program broke because of this you're a bad person' "; list($a[],$a[])=$a=[1,2]; var_dump($a);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0130.00918.55
8.3.50.0060.01620.19
8.3.40.0060.00918.71
8.3.30.0120.00418.94
8.3.20.0040.00721.90
8.3.10.0050.00321.90
8.3.00.0080.00021.92
8.2.180.0120.00618.29
8.2.170.0000.01522.96
8.2.160.0040.01122.16
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00317.84
8.2.120.0080.00026.35
8.2.110.0080.00320.39
8.2.100.0030.00917.91
8.2.90.0040.00419.05
8.2.80.0080.00017.97
8.2.70.0000.00817.46
8.2.60.0030.00518.16
8.2.50.0040.00418.10
8.2.40.0030.00520.58
8.2.30.0070.00019.38
8.2.20.0050.00318.21
8.2.10.0000.00818.13
8.2.00.0040.00417.69
8.1.280.0100.01025.92
8.1.270.0080.00022.18
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0060.00323.91
8.1.230.0070.00422.08
8.1.220.0050.00517.74
8.1.210.0000.00818.77
8.1.200.0030.00617.23
8.1.190.0050.00317.23
8.1.180.0000.00818.10
8.1.170.0050.00318.53
8.1.160.0040.00418.86
8.1.150.0000.00720.30
8.1.140.0040.00419.58
8.1.130.0000.00819.03
8.1.120.0030.00517.46
8.1.110.0040.00417.36
8.1.100.0040.00417.34
8.1.90.0030.00517.46
8.1.80.0070.00017.54
8.1.70.0000.00717.48
8.1.60.0050.00317.58
8.1.50.0040.00417.42
8.1.40.0040.00417.57
8.1.30.0000.00817.64
8.1.20.0000.00917.66
8.1.10.0040.00417.47
8.1.00.0080.00017.41
8.0.300.0070.00018.77
8.0.290.0000.00816.88
8.0.280.0030.00318.49
8.0.270.0040.00417.30
8.0.260.0000.00817.33
8.0.250.0030.00317.01
8.0.240.0000.00917.02
8.0.230.0000.00817.02
8.0.220.0030.00316.86
8.0.210.0050.00316.96
8.0.200.0060.00016.92
8.0.190.0000.00716.93
8.0.180.0100.00016.99
8.0.170.0030.00516.98
8.0.160.0080.00017.07
8.0.150.0000.00716.76
8.0.140.0030.00516.89
8.0.130.0030.00313.41
8.0.120.0070.00016.94
8.0.110.0040.00416.86
8.0.100.0040.00417.02
8.0.90.0030.00516.86
8.0.80.0060.01217.02
8.0.70.0030.00516.91
8.0.60.0040.00416.94
8.0.50.0040.00416.79
8.0.30.0120.00816.98
8.0.20.0150.00717.40
8.0.10.0070.00017.13
8.0.00.0100.00717.08
7.4.330.0030.00315.55
7.4.320.0060.00316.54
7.4.300.0030.00316.54
7.4.290.0060.00016.46
7.4.280.0040.00416.40
7.4.270.0040.00416.48
7.4.260.0030.00316.49
7.4.250.0040.00416.53
7.4.240.0070.00016.61
7.4.230.0000.00816.54
7.4.220.0150.00416.61
7.4.210.0080.01016.67
7.4.200.0030.00316.45
7.4.160.0120.01016.54
7.4.150.0160.00317.40
7.4.140.0220.01517.86
7.4.130.0080.01116.59
7.4.120.0130.01116.63
7.4.110.0170.00016.61
7.4.100.0130.00616.48
7.4.90.0060.01216.41
7.4.80.0110.00719.39
7.4.70.0090.00916.71
7.4.60.0120.00416.56
7.4.50.0060.00916.64
7.4.40.0100.01316.53
7.4.30.0100.00616.52
7.4.00.0070.00914.89
7.3.330.0030.00313.41
7.3.320.0050.00013.21
7.3.310.0060.00316.31
7.3.300.0000.00716.31
7.3.290.0000.00616.40
7.3.280.0090.01116.40
7.3.270.0000.01717.40
7.3.260.0080.01016.55
7.3.250.0140.00616.41
7.3.240.0070.01216.48
7.3.230.0030.01316.43
7.3.210.0100.00716.40
7.3.200.0070.01416.45
7.3.190.0170.00316.37
7.3.180.0080.00816.43
7.3.170.0060.01016.45
7.3.160.0190.00316.44
7.3.120.0070.01114.83
7.3.110.0070.01014.51
7.3.100.0090.00614.84
7.3.90.0080.00415.02
7.3.80.0040.01214.85
7.3.70.0100.00314.71
7.3.60.0030.01014.86
7.3.50.0030.01015.07
7.3.40.0100.00714.86
7.3.30.0060.00614.93
7.3.20.0090.00616.69
7.3.10.0060.00316.40
7.3.00.0070.01016.68
7.2.330.0110.00716.81
7.2.320.0060.01216.81
7.2.310.0110.00716.50
7.2.300.0060.01216.55
7.2.290.0060.01216.80
7.2.250.0040.01515.09
7.2.240.0090.01215.21
7.2.230.0060.01215.17
7.2.220.0040.01115.06
7.2.210.0120.00614.83
7.2.200.0040.00815.27
7.2.190.0000.01015.20
7.2.180.0100.00715.18
7.2.170.0000.00914.89
7.2.60.0300.01016.91
7.2.50.0100.00316.94
7.2.00.0030.01319.36
7.1.330.0040.01115.84
7.1.320.0070.00716.11
7.1.310.0070.00715.75
7.1.300.0030.00915.52
7.1.290.0070.00315.86
7.1.280.0000.01115.63
7.1.270.0000.01015.49
7.1.260.0030.00715.68
7.1.200.0000.00915.49
7.1.70.0050.00217.30
7.1.60.0060.00616.99
7.1.50.0130.01616.86
7.1.10.0100.06322.25
7.1.00.0070.07022.41
7.0.200.0060.01216.97
7.0.150.0170.06721.84
7.0.140.0200.07721.79
7.0.130.0200.06721.98
7.0.120.0070.06722.04
7.0.110.0200.07321.71
7.0.100.0170.05021.97
7.0.90.0070.06721.91
7.0.80.0100.08021.74
7.0.70.0170.05321.81
7.0.60.0130.05721.91
7.0.50.0030.07021.86
7.0.40.0200.04721.94
7.0.30.0100.06021.91
7.0.20.0130.06721.86
7.0.10.0130.06021.84
7.0.00.0100.07321.89

preferences:
80.21 ms | 401 KiB | 5 Q