3v4l.org

run code in 300+ PHP versions simultaneously
<?php // overly simplified example function test1() { $a = 3; test2(); } function test2() { echo $a; } // the actual idea is to do something like this // main.php $vars = []; function load_file($path) { if(is_file($path)) { $GLOBALS['path'] = $path; load_isolated(); } } function load_isolated() { extract($GLOBALS['vars']); require($GLOBALS['path']); $GLOBALS['vars'] = get_defined_vars(); } load_file('a.php'); // a.php $a = 3; load_file('b.php'); //b.php echo $a; // warning or error that var $a doesn't exist because get_defined_vars() was never called yata yata

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.0090.01218.65
8.3.50.0140.00316.48
8.3.40.0040.01118.70
8.3.30.0040.01118.79
8.3.20.0040.00420.35
8.3.10.0080.00022.16
8.3.00.0030.00619.68
8.2.180.0140.00416.88
8.2.170.0070.00722.96
8.2.160.0100.01019.28
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0070.00020.50
8.2.120.0040.00426.35
8.2.110.0090.00022.08
8.2.100.0060.00617.84
8.2.90.0000.00818.03
8.2.80.0040.00418.97
8.2.70.0070.00317.63
8.2.60.0030.00617.63
8.2.50.0050.00317.63
8.2.40.0040.00417.63
8.2.30.0040.00419.27
8.2.20.0000.00817.96
8.2.10.0100.00018.07
8.2.00.0070.00018.07
8.1.280.0060.00825.92
8.1.270.0040.00422.10
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0100.00020.91
8.1.230.0040.00722.79
8.1.220.0000.00817.77
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0000.00817.10
8.1.180.0050.00318.10
8.1.170.0070.00017.62
8.1.160.0030.00318.98
8.1.150.0030.00318.93
8.1.140.0040.00419.39
8.1.130.0070.00020.68
8.1.120.0030.00517.42
8.1.110.0000.00817.31
8.1.100.0030.00617.43
8.1.90.0000.00817.30
8.1.80.0000.00717.43
8.1.70.0000.00717.43
8.1.60.0030.00617.52
8.1.50.0040.00417.43
8.1.40.0040.00417.53
8.1.30.0040.00417.65
8.1.20.0000.00817.61
8.1.10.0040.00417.57
8.1.00.0030.00517.52
8.0.300.0050.00220.21
8.0.290.0000.00716.88
8.0.280.0030.00318.60
8.0.270.0070.00017.38
8.0.260.0040.00418.97
8.0.250.0000.00717.12
8.0.240.0040.00417.00
8.0.230.0000.00717.03
8.0.220.0000.00816.97
8.0.210.0000.00716.93
8.0.200.0040.00417.08
8.0.190.0040.00417.06
8.0.180.0000.00717.02
8.0.170.0040.00416.93
8.0.160.0080.00316.89
8.0.150.0040.00416.81
8.0.140.0030.00316.83
8.0.130.0000.00713.20
8.0.120.0030.00516.89
8.0.110.0040.00417.01
8.0.100.0040.00417.04
8.0.90.0040.00417.01
8.0.80.0030.02117.04
8.0.70.0030.00516.76
8.0.60.0000.00716.85
8.0.50.0000.00816.86
8.0.30.0110.00617.21
8.0.20.0100.01017.40
8.0.10.0000.00816.91
8.0.00.0100.00716.72
7.4.330.0050.00015.55
7.4.320.0060.00016.54
7.4.300.0000.00716.54
7.4.290.0000.00716.52
7.4.280.0040.00416.61
7.4.270.0030.00316.60
7.4.260.0060.00316.47
7.4.250.0070.00016.58
7.4.240.0040.00416.61
7.4.230.0000.00716.28
7.4.220.0000.00816.67
7.4.210.0080.00816.49
7.4.200.0040.00416.73
7.4.160.0030.01216.43
7.4.150.0110.00717.40
7.4.140.0100.00817.86
7.4.130.0090.00916.82
7.4.120.0110.00816.53
7.4.110.0080.00816.59
7.4.100.0140.00316.52
7.4.90.0070.01116.57
7.4.80.0040.01419.39
7.4.70.0070.01016.67
7.4.60.0100.00616.55
7.4.50.0040.01216.45
7.4.40.0120.00616.39
7.4.30.0090.01016.67
7.4.00.0040.01115.03
7.3.330.0030.00313.34
7.3.320.0000.00713.29
7.3.310.0000.00816.50
7.3.300.0000.00716.31
7.3.290.0090.00716.42
7.3.280.0100.00716.42
7.3.270.0060.01317.40
7.3.260.0100.00716.42
7.3.250.0130.00716.45
7.3.240.0120.00616.48
7.3.230.0160.00016.52
7.3.210.0070.01016.45
7.3.200.0030.01416.51
7.3.190.0070.01016.63
7.3.180.0030.01416.48
7.3.170.0070.01016.68
7.3.160.0120.00316.39
7.3.120.0110.00714.91
7.3.110.0060.00614.75
7.3.100.0120.00614.89
7.3.90.0090.00614.95
7.3.80.0100.00714.72
7.3.70.0040.00414.64
7.3.60.0090.00614.86
7.3.50.0100.00314.89
7.3.40.0090.00614.91
7.3.30.0130.00014.83
7.3.20.0030.01116.70
7.3.10.0030.00616.62
7.3.00.0030.01216.48
7.2.330.0120.00916.63
7.2.320.0090.00916.57
7.2.310.0110.00816.54
7.2.300.0170.00016.44
7.2.290.0040.01116.61
7.2.240.0000.01814.85
7.2.230.0070.01014.99
7.2.220.0100.00714.81
7.2.210.0070.01015.18
7.2.200.0060.00915.13
7.2.190.0090.00315.09
7.2.180.0030.01314.72
7.2.170.0030.01014.82
7.2.160.0090.00314.88
7.2.150.0110.00416.63
7.2.140.0040.01117.00
7.2.130.0060.00616.61
7.2.120.0030.00816.75
7.2.110.0070.01016.89
7.2.100.0090.00916.89
7.2.90.0030.01117.00
7.2.80.0000.01516.90
7.2.70.0000.01516.78
7.2.60.0070.01016.70
7.2.50.0070.00716.83
7.2.40.0060.00616.63
7.2.30.0030.01216.75
7.2.20.0040.01216.84
7.2.10.0090.00616.89
7.2.00.0070.01016.97
7.1.330.0100.00315.98
7.1.320.0030.01015.96
7.1.310.0110.00316.06
7.1.300.0030.00915.85
7.1.290.0040.01116.00
7.1.280.0080.00815.98
7.1.270.0090.00615.62
7.1.260.0030.01015.59
7.1.250.0060.00615.89
7.1.200.0060.00615.67
7.1.80.2410.01315.77
7.1.70.2150.00615.43
7.1.60.2470.02033.01
7.1.50.2650.02232.99
7.1.40.2630.01032.57
7.1.30.2620.01632.71
7.1.20.2250.01632.64
7.1.10.2330.01314.67
7.1.00.2430.01214.73
7.0.200.2620.01515.00
7.0.190.2440.01314.62
7.0.180.2170.00614.51
7.0.170.2510.01014.44
7.0.160.2130.01314.32
7.0.150.2480.01214.61
7.0.140.2320.01514.40
7.0.130.2390.00614.70
7.0.120.2000.00914.52
7.0.110.2350.01314.59
7.0.100.2360.01414.35
7.0.90.2340.01314.41
7.0.80.2320.00614.41
7.0.70.2210.01314.37
7.0.60.3020.01014.39
7.0.50.2150.00814.75
7.0.40.2370.00714.57
7.0.30.2340.00814.64
7.0.20.2340.01414.65
7.0.10.2370.01014.68
7.0.00.2410.00614.56

preferences:
61.83 ms | 401 KiB | 5 Q