3v4l.org

run code in 300+ PHP versions simultaneously
<?php class asset { protected $id; function __construct($id) { $this->id = $id; } function getId() { return $this->id; } } $getIdsCode = 'array_walk(count($input), array($asset, "getId"))'; // UPDATE THIS if (strpos($getIdsCode, ';') !== false) die('code should not contain ; !'); $getIdsCode = preg_replace('/\s+/', '', $getIdsCode); echo 'code length '.strlen($getIdsCode)."\n"; $input = array(new asset(10),new asset(20),new asset(30)); echo eval("return $getIdsCode;") . "\n"; $input = array(new asset(40),new asset(50),new asset(60)); echo eval("return $getIdsCode;") . "\n"; ?>

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.0150.00016.88
8.3.50.0090.01123.07
8.3.40.0170.00319.04
8.3.30.0080.00619.17
8.3.20.0040.00420.17
8.3.10.0050.00323.46
8.3.00.0040.00419.50
8.2.180.0090.00618.68
8.2.170.0000.01522.96
8.2.160.0040.01120.23
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0070.00020.95
8.2.110.0030.00720.36
8.2.100.0040.00717.97
8.2.90.0000.00817.88
8.2.80.0070.00418.05
8.2.70.0000.00817.80
8.2.60.0000.00818.16
8.2.50.0050.00319.72
8.2.40.0000.00818.16
8.2.30.0060.00318.16
8.2.20.0030.00618.02
8.2.10.0040.00418.17
8.2.00.0040.00417.99
8.1.280.0110.00425.92
8.1.270.0070.00023.96
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0090.00022.00
8.1.230.0060.00623.93
8.1.220.0080.00017.78
8.1.210.0040.00418.77
8.1.200.0060.00317.47
8.1.190.0000.00817.48
8.1.180.0040.00418.10
8.1.170.0090.00018.82
8.1.160.0050.00221.98
8.1.150.0030.00719.04
8.1.140.0090.00017.68
8.1.130.0000.00717.86
8.1.120.0070.00017.57
8.1.110.0060.00317.59
8.1.100.0050.00217.58
8.1.90.0040.00417.51
8.1.80.0050.00317.63
8.1.70.0040.00417.56
8.1.60.0050.00317.64
8.1.50.0060.00317.63
8.1.40.0040.00417.71
8.1.30.0040.00417.66
8.1.20.0080.00017.82
8.1.10.0000.00917.63
8.1.00.0030.00617.65
8.0.300.0070.00019.89
8.0.290.0080.00016.88
8.0.280.0030.00618.36
8.0.270.0040.00417.24
8.0.260.0060.00017.39
8.0.250.0050.00217.20
8.0.240.0030.00617.10
8.0.230.0000.00717.13
8.0.220.0030.00317.04
8.0.210.0070.00017.01
8.0.200.0030.00317.19
8.0.190.0050.00217.25
8.0.180.0040.00717.17
8.0.170.0040.00417.03
8.0.160.0030.00317.11
8.0.150.0040.00416.98
8.0.140.0000.00717.04
8.0.130.0030.00613.59
8.0.120.0080.00017.13
8.0.110.0040.00417.15
8.0.100.0060.00317.09
8.0.90.0000.00717.16
8.0.80.0060.01017.11
8.0.70.0040.00416.96
8.0.60.0030.00516.99
8.0.50.0000.00717.14
8.0.30.0130.00817.17
8.0.20.0100.00817.40
8.0.10.0040.00417.19
8.0.00.0080.01016.95
7.4.330.0050.00015.00
7.4.320.0030.00316.64
7.4.300.0060.00016.73
7.4.290.0030.00316.88
7.4.280.0040.00416.76
7.4.270.0070.00016.89
7.4.260.0000.00716.71
7.4.250.0070.00016.82
7.4.240.0060.00116.85
7.4.230.0030.00316.55
7.4.220.0070.01016.69
7.4.210.0070.00716.84
7.4.200.0000.00716.93
7.4.160.0160.00316.64
7.4.150.0140.00317.40
7.4.140.0100.00717.86
7.4.130.0110.01016.68
7.4.120.0060.01216.75
7.4.110.0030.01916.57
7.4.100.0120.00616.70
7.4.90.0140.00416.77
7.4.80.0140.00319.39
7.4.70.0100.00716.73
7.4.60.0120.00616.64
7.4.50.0000.00716.77
7.4.40.0120.00616.75
7.4.30.0110.00516.65
7.4.00.0080.01015.25
7.3.330.0050.00213.61
7.3.320.0030.00313.36
7.3.310.0000.00816.64
7.3.300.0040.00416.47
7.3.290.0060.00916.65
7.3.280.0100.00616.58
7.3.270.0070.01017.40
7.3.260.0080.01216.57
7.3.250.0070.01316.77
7.3.240.0080.00816.79
7.3.230.0150.00816.43
7.3.210.0120.00416.50
7.3.200.0170.01019.39
7.3.190.0030.01216.58
7.3.180.0030.01716.81
7.3.170.0150.00016.74
7.3.160.0080.00816.84
7.3.120.0070.01015.28
7.3.110.0040.01414.95
7.3.100.0060.00614.90
7.3.90.0000.01214.96
7.3.80.0030.01015.05
7.3.70.0090.00614.95
7.3.60.0030.01015.20
7.3.50.0070.00715.11
7.3.40.0110.00415.16
7.3.30.0150.00015.03
7.3.20.0030.01216.88
7.3.10.0070.00716.99
7.3.00.0140.00016.68
7.2.330.0060.01316.99
7.2.320.0090.00916.77
7.2.310.0070.01016.80
7.2.300.0100.00616.78
7.2.290.0070.01116.76
7.2.250.0070.01115.29
7.2.240.0130.00715.07
7.2.230.0080.00315.32
7.2.220.0070.00715.11
7.2.210.0060.00915.39
7.2.200.0070.00715.06
7.2.190.0030.01215.26
7.2.180.0070.00715.41
7.2.170.0100.00715.34
7.2.60.0030.01017.22
7.2.00.0080.00819.60
7.1.330.0030.01415.83
7.1.320.0060.00915.83
7.1.310.0070.00716.09
7.1.300.0100.00315.95
7.1.290.0080.00515.73
7.1.280.0070.00715.73
7.1.270.0080.00815.97
7.1.260.0000.01616.05
7.1.200.0050.00515.95
7.1.100.0030.00718.44
7.1.70.0030.00517.48
7.1.60.0110.01519.46
7.1.50.0000.02116.97
7.1.00.0030.07322.32
7.0.200.0000.00816.91
7.0.140.0070.07321.92
7.0.60.0100.06319.87
7.0.50.0070.04317.91
7.0.40.0100.05320.23
7.0.30.0500.05020.12
7.0.20.0300.05020.22
7.0.10.0000.07020.32
7.0.00.0130.04720.18
5.6.210.0030.06720.73
5.6.200.0030.04718.18
5.6.190.0100.05020.64
5.6.180.0370.06720.41
5.6.170.0300.08320.54
5.6.160.0170.07720.38
5.6.150.0100.07718.15
5.6.140.0100.04318.16
5.6.130.0130.06718.23
5.6.120.0130.07721.11
5.6.110.0070.05321.12
5.6.100.0170.07021.14
5.6.90.0030.04321.04
5.6.80.0100.06720.41
5.5.350.0030.07720.43
5.5.340.0000.09017.99
5.5.330.0130.06320.37
5.5.320.0500.05720.25
5.5.310.0230.06720.36
5.5.300.0130.06018.09
5.5.290.0030.07718.05
5.5.280.0000.09020.66
5.5.270.0070.08020.68
5.5.260.0030.04020.77
5.5.250.0100.07720.70
5.5.240.4000.04020.27
5.4.450.0500.05719.48
5.4.440.0830.06019.70
5.4.430.0870.06319.57
5.4.420.0600.06019.63
5.4.410.0800.06719.57
5.4.400.0730.05019.02
5.4.390.0630.05319.38
5.4.380.0330.05018.78
5.4.370.0230.06018.50
5.4.360.0200.06018.83
5.4.350.0430.07018.54
5.4.340.0330.08018.48
5.4.320.0040.03812.50
5.4.310.0090.03412.50
5.4.300.0090.03212.51
5.4.290.0100.03412.50
5.4.280.0030.03812.40
5.4.270.0070.03512.40
5.4.260.0030.04012.40
5.4.250.0060.03712.40
5.4.240.0060.03512.39
5.4.230.0040.03912.39
5.4.220.0070.03512.39
5.4.210.0040.03712.39
5.4.200.0050.03812.39
5.4.190.0080.03412.39
5.4.180.0090.03412.39
5.4.170.0050.03912.40
5.4.160.0120.02912.40
5.4.150.0030.03812.39
5.4.140.0060.03612.08
5.4.130.0020.03812.07
5.4.120.0050.03512.02
5.4.110.0060.03512.02
5.4.100.0070.03412.02
5.4.90.0080.03412.02
5.4.80.0100.03212.02
5.4.70.0060.03412.01
5.4.60.0100.03912.01
5.4.50.0030.04512.01
5.4.40.0040.03812.00
5.4.30.0080.04112.00
5.4.20.0050.03512.00
5.4.10.0050.03512.00
5.4.00.0090.03311.49
5.3.290.0020.04312.80
5.3.280.0040.04112.71
5.3.270.0060.04312.72
5.3.260.0070.03912.72
5.3.250.0070.04112.72
5.3.240.0080.04512.72
5.3.230.0050.03912.71
5.3.220.0050.03912.68
5.3.210.0050.04312.68
5.3.200.0040.03812.68
5.3.190.0040.03912.67
5.3.180.0070.03512.68
5.3.170.0060.03712.67
5.3.160.0050.03712.68
5.3.150.0080.04212.68
5.3.140.0050.03712.66
5.3.130.0070.03712.66
5.3.120.0040.04112.66
5.3.110.0060.03812.66
5.3.100.0090.04512.13
5.3.90.0090.04412.11
5.3.80.0030.03812.10
5.3.70.0050.03612.09
5.3.60.0050.03612.08
5.3.50.0070.03912.03
5.3.40.0100.04512.03
5.3.30.0060.04011.99
5.3.20.0040.03911.77
5.3.10.0060.04211.73
5.3.00.0070.04111.72
5.2.170.0060.0309.24
5.2.160.0040.0309.24
5.2.150.0050.0429.24
5.2.140.0070.0289.23
5.2.130.0020.0329.20
5.2.120.0040.0299.19
5.2.110.0070.0339.20
5.2.100.0020.0319.20
5.2.90.0060.0309.19
5.2.80.0040.0309.19
5.2.70.0090.0329.19
5.2.60.0080.0369.14
5.2.50.0050.0389.11
5.2.40.0050.0379.09
5.2.30.0080.0369.07
5.2.20.0100.0469.06
5.2.10.0070.0368.97
5.2.00.0050.0398.83
5.1.60.0050.0228.11
5.1.50.0050.0248.11
5.1.40.0050.0238.09
5.1.30.0040.0268.43
5.1.20.0060.0358.46
5.1.10.0060.0338.18
5.1.00.0040.0368.18
5.0.50.0070.0226.66
5.0.40.0050.0346.53
5.0.30.0050.0366.33
5.0.20.0050.0296.30
5.0.10.0030.0276.28
5.0.00.0030.0316.27
4.4.90.0020.0174.78
4.4.80.0020.0164.76
4.4.70.0030.0154.75
4.4.60.0020.0164.75
4.4.50.0040.0154.77
4.4.40.0030.0254.71
4.4.30.0010.0174.75
4.4.20.0020.0164.84
4.4.10.0050.0184.84
4.4.00.0080.0364.76
4.3.110.0050.0134.67
4.3.100.0010.0164.66
4.3.90.0060.0194.63
4.3.80.0020.0304.58
4.3.70.0040.0134.63
4.3.60.0020.0154.63
4.3.50.0020.0164.63
4.3.40.0030.0234.54
4.3.30.0020.0163.30
4.3.20.0050.0133.28
4.3.10.0020.0153.24
4.3.00.0070.0237.77

preferences:
43.46 ms | 401 KiB | 5 Q