3v4l.org

run code in 300+ PHP versions simultaneously
<?php @ini_set('display_errors', 'on'); class Configuration { public static function get($param) { return true; } } class Cart { public function getProducts() { return array(1); } } class Context { public $cart; public function __construct() { $this->cart = new Cart(); } public static function getContext() { return new Context(); } } if (Configuration::get('LEGAL_SHIPTAXMETH') && $cart = Context::getContext()->cart && $products = $cart->getProducts() && !empty($products)) { echo "OK"; } /** * The above code snippet fails, because I think the condition is parsed like this: * * Configuration::get('LEGAL_SHIPTAXMETH') && * $cart = (Context::getContext()->cart && $products = $cart->getProducts()) * && !empty($products) * * so $cart is undefined when getProducts is called * */

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.40.0110.00418.85
8.3.30.0040.01419.17
8.3.20.0070.00020.13
8.3.10.0050.00320.52
8.3.00.0040.00419.68
8.2.170.0070.00722.96
8.2.160.0070.00720.20
8.2.150.0090.00024.18
8.2.140.0000.00924.66
8.2.130.0030.00626.16
8.2.120.0040.00422.05
8.2.110.0060.00320.37
8.2.100.0040.00818.22
8.2.90.0000.00919.27
8.2.80.0000.00817.97
8.2.70.0000.00917.63
8.2.60.0090.00417.79
8.2.50.0040.00418.07
8.2.40.0000.00818.09
8.2.30.0030.00619.22
8.2.20.0000.00717.67
8.2.10.0040.00418.14
8.2.00.0050.00217.66
8.1.270.0060.00323.82
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.92
8.1.230.0040.00719.16
8.1.220.0050.00317.74
8.1.210.0030.00518.77
8.1.200.0030.00817.23
8.1.190.0000.00817.25
8.1.180.0000.00918.10
8.1.170.0090.00318.32
8.1.160.0070.00022.03
8.1.150.0040.00418.76
8.1.140.0000.00717.44
8.1.130.0040.00417.75
8.1.120.0040.00417.47
8.1.110.0030.00517.44
8.1.100.0040.00417.47
8.1.90.0070.00017.44
8.1.80.0000.00717.44
8.1.70.0030.00317.39
8.1.60.0040.00417.61
8.1.50.0000.00717.58
8.1.40.0070.00417.58
8.1.30.0090.00017.62
8.1.20.0000.00817.57
8.1.10.0000.00717.54
8.1.00.0000.00717.38
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0040.00418.45
8.0.270.0000.00817.27
8.0.260.0030.00317.28
8.0.250.0060.00017.00
8.0.240.0040.00417.03
8.0.230.0000.00717.00
8.0.220.0070.00016.96
8.0.210.0000.00716.94
8.0.200.0000.00817.07
8.0.190.0060.00317.07
8.0.180.0070.00016.90
8.0.170.0000.00816.91
8.0.160.0040.00416.85
8.0.150.0000.00716.88
8.0.140.0060.00616.91
8.0.130.0030.00313.38
8.0.120.0050.00316.87
8.0.110.0000.00816.92
8.0.100.0030.00316.88
8.0.90.0040.00417.04
8.0.80.0150.00016.85
8.0.70.0040.00316.95
8.0.60.0040.00416.85
8.0.50.0050.00216.95
8.0.30.0140.00517.08
8.0.20.0080.01017.40
8.0.10.0040.00416.96
8.0.00.0100.00717.05
7.4.330.0050.00015.07
7.4.320.0000.00616.57
7.4.300.0030.00316.37
7.4.290.0070.00016.47
7.4.280.0040.00416.54
7.4.270.0040.00416.46
7.4.260.0030.00316.34
7.4.250.0000.00716.47
7.4.240.0040.00416.52
7.4.230.0000.00716.56
7.4.220.0200.00616.49
7.4.210.0040.01616.39
7.4.200.0000.00716.55
7.4.160.0130.00316.51
7.4.150.0070.01117.40
7.4.140.0090.00817.86
7.4.130.0110.00616.48
7.4.120.0110.00616.44
7.4.110.0070.01016.45
7.4.100.0120.00616.54
7.4.90.0130.00316.37
7.4.80.0150.00616.51
7.4.70.0090.00916.72
7.4.60.0090.01016.36
7.4.50.0040.00016.36
7.4.40.0060.00916.61
7.4.30.0110.00716.40
7.4.00.0030.01314.96
7.3.330.0030.00313.35
7.3.320.0050.00013.25
7.3.310.0000.00716.23
7.3.300.0040.00416.25
7.3.290.0100.01016.33
7.3.280.0080.00916.35
7.3.270.0090.00917.40
7.3.260.0120.01216.64
7.3.250.0060.01116.59
7.3.240.0150.00316.47
7.3.230.0100.00616.39
7.3.210.0050.01116.32
7.3.200.0090.00819.39
7.3.190.0120.01216.47
7.3.180.0130.01016.50
7.3.170.0040.01516.40
7.3.160.0160.00316.61
7.3.10.0080.00716.70
7.3.00.0100.00616.72
7.2.330.0130.01016.48
7.2.320.0100.00616.68
7.2.310.0160.00616.80
7.2.300.0100.00616.66
7.2.290.0090.01216.75
7.2.130.0050.01016.82
7.2.120.0050.00816.77
7.2.110.0090.00516.86
7.2.100.0080.00416.96
7.2.90.0030.01216.99
7.2.80.0070.00816.95
7.2.70.0040.00916.88
7.2.60.0070.00616.92
7.2.50.0070.00517.09
7.2.40.0110.00216.78
7.2.30.0020.00817.04
7.2.20.0040.00616.91
7.2.10.0080.00516.66
7.2.00.0050.00817.57
7.1.250.0090.00215.74
7.1.200.0040.00815.63
7.1.100.0000.01618.30
7.1.70.0000.01017.28
7.1.60.0040.01819.32
7.1.50.0040.01116.81
7.1.00.0070.07322.45
7.0.200.0060.00616.63
7.0.140.0030.07322.08
7.0.60.0070.08719.86
7.0.50.0170.06717.88
7.0.40.0100.03720.40
7.0.30.0500.04320.07
7.0.20.0230.08020.16
7.0.10.0100.08320.19
7.0.00.0070.08720.19
5.6.280.0070.07020.79
5.6.210.0100.07720.77
5.6.200.0130.05018.29
5.6.190.0030.04720.33
5.6.180.3230.04020.48
5.6.170.0170.05320.57
5.6.160.0030.09020.55
5.6.150.0030.05318.13
5.6.140.0030.04718.16
5.6.130.0030.04018.14
5.6.120.0030.08321.03
5.6.110.0070.08721.00
5.6.100.0030.04021.05
5.6.90.0030.06320.97
5.6.80.0130.06320.36
5.6.70.3600.03020.38
5.5.350.0270.07720.44
5.5.340.0130.07017.98
5.5.330.0200.03020.27
5.5.320.0270.04020.36
5.5.310.0300.07020.34
5.5.300.0170.07717.99
5.5.290.0070.03718.07
5.5.280.0070.07720.79
5.5.270.0100.08020.90
5.5.260.0170.06720.96
5.5.250.0070.08020.59
5.5.240.0170.08020.38
5.4.450.0370.05019.63
5.4.440.1200.08019.20
5.4.430.0700.06019.35
5.4.420.0500.04719.45
5.4.410.1270.05719.21
5.4.400.0730.05319.27
5.4.390.0700.05019.16
5.4.380.0400.04718.84
5.4.370.0570.06718.79
5.4.360.0230.06718.82
5.4.350.0330.05718.81
5.4.340.0330.05318.64
5.4.320.0060.03612.52
5.4.310.0090.04312.50
5.4.300.0040.04612.51
5.4.290.0110.04012.50
5.4.280.0100.03212.40
5.4.270.0070.04012.40
5.4.260.0060.03712.40
5.4.250.0020.04712.40
5.4.240.0090.03212.40
5.4.230.0050.03712.40
5.4.220.0050.03712.40
5.4.210.0060.04112.39
5.4.200.0050.04512.39
5.4.190.0070.03512.39
5.4.180.0080.03712.39
5.4.170.0050.03612.40
5.4.160.0120.03212.40
5.4.150.0060.03512.39
5.4.140.0090.03412.08
5.4.130.0040.03712.05
5.4.120.0060.03612.02
5.4.110.0060.04212.02
5.4.100.0060.03612.02
5.4.90.0080.03612.02
5.4.80.0070.04212.01
5.4.70.0080.03212.01
5.4.60.0060.03512.02
5.4.50.0050.03512.01
5.4.40.0100.03612.00
5.4.30.0080.03412.00
5.4.20.0070.03912.00
5.4.10.0070.03812.00
5.4.00.0050.04111.49
5.3.290.0110.03812.80
5.3.280.0080.03712.71
5.3.270.0070.04512.72
5.3.260.0080.04212.72
5.3.250.0120.03812.72
5.3.240.0040.04312.72
5.3.230.0060.04012.71
5.3.220.0060.03612.68
5.3.210.0070.03812.68
5.3.200.0060.03612.68
5.3.190.0060.03812.68
5.3.180.0040.03812.67
5.3.170.0050.03712.67
5.3.160.0090.03912.68
5.3.150.0050.03712.67
5.3.140.0050.03612.66
5.3.130.0030.04912.66
5.3.120.0070.03812.66
5.3.110.0090.03512.66
5.3.100.0050.03712.12
5.3.90.0090.03212.11
5.3.80.0080.03612.10
5.3.70.0060.03612.10
5.3.60.0060.03812.09
5.3.50.0050.03712.04
5.3.40.0080.04612.04
5.3.30.0070.03811.99
5.3.20.0060.03711.78
5.3.10.0030.03811.74
5.3.00.0090.03611.72
5.2.170.0050.0319.23
5.2.160.0040.0309.23
5.2.150.0040.0329.23
5.2.140.0030.0339.23
5.2.130.0080.0319.19
5.2.120.0030.0299.19
5.2.110.0070.0289.20
5.2.100.0040.0299.19
5.2.90.0030.0309.19
5.2.80.0030.0309.19
5.2.70.0040.0309.19
5.2.60.0030.0309.14
5.2.50.0080.0349.10
5.2.40.0080.0349.08
5.2.30.0050.0289.06
5.2.20.0060.0329.05
5.2.10.0060.0298.96
5.2.00.0090.0328.82
5.1.60.0060.0308.09
5.1.50.0050.0258.09
5.1.40.0030.0278.08
5.1.30.0050.0258.43
5.1.20.0030.0288.45
5.1.10.0030.0298.17
5.1.00.0080.0228.17
5.0.50.0050.0206.65
5.0.40.0040.0186.51
5.0.30.0010.0336.32
5.0.20.0020.0216.29
5.0.10.0070.0166.27
5.0.00.0040.0316.26
4.4.90.0060.0194.78
4.4.80.0050.0224.76
4.4.70.0040.0144.75
4.4.60.0030.0164.76
4.4.50.0020.0164.77
4.4.40.0030.0244.71
4.4.30.0040.0144.76
4.4.20.0050.0184.84
4.4.10.0050.0144.85
4.4.00.0020.0264.76
4.3.110.0020.0164.67
4.3.100.0020.0164.66
4.3.90.0040.0204.63
4.3.80.0030.0254.58
4.3.70.0010.0194.63
4.3.60.0030.0144.63
4.3.50.0020.0164.63
4.3.40.0040.0234.54
4.3.30.0030.0153.30
4.3.20.0020.0173.28
4.3.10.0020.0193.23
4.3.00.0100.0176.98

preferences:
41.46 ms | 400 KiB | 5 Q