3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { return 1234; } class Foo { public static function asdf() { return 1234; } } $iterations = 1000000; $process = foo(); $process = Foo::asdf(); // Old $a = microtime( true ); for ( $i = 0; $i < $iterations; $i++ ) { $process = foo(); } $b = microtime( true ); $delta1 = $b - $a; // New $x = microtime( true ); for ( $j = 0; $j < $iterations; $j++ ) { $process = Foo::asdf(); } $y = microtime( true ); $delta2 = $y - $x; $percentage = $delta2 / $delta1 * 100; if ( $delta2 < $delta1 ) { printf( 'static method is %.2f%% faster', $percentage ); } else { printf( 'function call is %.2f%% faster', $percentage ); }

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.2.70.0130.03617.38
8.2.60.0100.03717.38
8.2.50.0100.03817.13
8.2.40.0070.03717.38
8.2.30.0120.04017.50
8.2.20.0130.03717.75
8.2.10.0170.03517.62
8.2.00.0070.03617.48
8.1.200.0070.03617.23
8.1.190.0060.03818.93
8.1.180.0030.04317.10
8.1.170.0060.03218.88
8.1.160.0120.02419.13
8.1.150.0080.03718.63
8.1.140.0070.03319.00
8.1.130.0100.03517.13
8.1.120.0060.03617.34
8.1.110.0030.04117.25
8.1.100.0070.03817.35
8.1.90.0120.03117.38
8.1.80.0000.04517.47
8.1.70.0030.04419.00
8.1.60.0100.03517.38
8.1.50.0070.03717.38
8.1.40.0070.03717.38
8.1.30.0040.04617.25
8.1.20.0000.04517.25
8.1.10.0100.03417.60
8.1.00.0030.04217.34
8.0.290.0060.03916.58
8.0.280.0030.03818.49
8.0.270.0070.03816.75
8.0.260.0030.04216.58
8.0.250.0060.03516.88
8.0.240.0040.03716.75
8.0.230.0030.04116.63
8.0.220.0040.04116.58
8.0.210.0030.03816.75
8.0.200.0030.04116.63
8.0.190.0040.03918.54
8.0.180.0000.04616.58
8.0.170.0070.04016.75
8.0.160.0130.03216.63
8.0.150.0040.03716.63
8.0.140.0120.03016.63
8.0.130.0070.03616.58
8.0.120.0060.03316.63
8.0.110.0090.02918.49
8.0.100.0090.02818.48
8.0.90.0000.03818.48
8.0.80.0000.03718.36
8.0.70.0030.03518.48
8.0.60.0000.03718.36
8.0.50.0100.03018.24
8.0.30.0070.03118.36
8.0.20.0100.02618.37
8.0.10.0030.03418.62

preferences:
36.42 ms | 403 KiB | 5 Q