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($input, array($item->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.70.0070.01118.56
8.3.60.0080.00816.63
8.3.50.0120.01023.01
8.3.40.0120.00319.08
8.3.30.0040.01419.23
8.3.20.0070.00020.22
8.3.10.0040.00423.70
8.3.00.0000.00819.76
8.2.180.0090.00618.38
8.2.170.0040.01122.96
8.2.160.0120.00320.39
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0080.00021.22
8.2.110.0110.00420.52
8.2.100.0120.00018.07
8.2.90.0040.00418.19
8.2.80.0050.00317.97
8.2.70.0030.00617.88
8.2.60.0050.00517.93
8.2.50.0080.00018.07
8.2.40.0030.00520.07
8.2.30.0000.00817.98
8.2.20.0040.00418.04
8.2.10.0000.00918.17
8.2.00.0040.00417.91
8.1.280.0070.01125.92
8.1.270.0080.00023.81
8.1.260.0040.00426.35
8.1.250.0030.00628.09
8.1.240.0060.00322.19
8.1.230.0090.00320.97
8.1.220.0000.00817.74
8.1.210.0060.00318.97
8.1.200.0040.00417.48
8.1.190.0040.00417.35
8.1.180.0000.00818.10
8.1.170.0040.00418.78
8.1.160.0000.00821.98
8.1.150.0040.00418.93
8.1.140.0000.00717.59
8.1.130.0000.00717.88
8.1.120.0000.00717.51
8.1.110.0040.00417.58
8.1.100.0000.00717.65
8.1.90.0000.00717.61
8.1.80.0040.00417.56
8.1.70.0030.00317.64
8.1.60.0000.00817.77
8.1.50.0030.00617.61
8.1.40.0060.00317.68
8.1.30.0000.00817.77
8.1.20.0000.00817.72
8.1.10.0000.00817.71
8.1.00.0000.00817.67
8.0.300.0000.00820.03
8.0.290.0000.00817.00
8.0.280.0070.00018.50
8.0.270.0080.00017.22
8.0.260.0000.00617.29
8.0.250.0000.00717.20
8.0.240.0030.00617.10
8.0.230.0040.00417.07
8.0.220.0000.00717.09
8.0.210.0030.00317.08
8.0.200.0060.00017.02
8.0.190.0040.00417.14
8.0.180.0110.00017.13
8.0.170.0060.00317.12
8.0.160.0000.00717.19
8.0.150.0040.00416.96
8.0.140.0000.00816.89
8.0.130.0040.00413.54
8.0.120.0030.00516.98
8.0.110.0050.00317.10
8.0.100.0040.00416.98
8.0.90.0040.00417.15
8.0.80.0100.00617.08
8.0.70.0000.00717.04
8.0.60.0050.00217.06
8.0.50.0020.00517.00
8.0.30.0110.00817.42
8.0.20.0160.00817.49
8.0.10.0000.00817.08
8.0.00.0070.01216.97
7.4.330.0070.00015.00
7.4.320.0000.00716.84
7.4.300.0070.00016.80
7.4.290.0000.00716.82
7.4.280.0040.00416.78
7.4.270.0030.00316.82
7.4.260.0000.00716.64
7.4.250.0040.00416.70
7.4.240.0030.00516.86
7.4.230.0000.00816.84
7.4.220.0060.01216.95
7.4.210.0000.01316.64
7.4.200.0030.00316.71
7.4.160.0060.00916.84
7.4.150.0180.00717.40
7.4.140.0120.00517.86
7.4.130.0080.01016.80
7.4.120.0120.00816.71
7.4.110.0140.00316.70
7.4.100.0070.01416.51
7.4.90.0100.00716.61
7.4.80.0070.01019.39
7.4.70.0080.00816.74
7.4.60.0090.00616.70
7.4.50.0030.00516.55
7.4.40.0110.00516.63
7.4.30.0080.00816.94
7.4.00.0050.01215.21
7.3.330.0000.00613.56
7.3.320.0060.00013.54
7.3.310.0070.00016.62
7.3.300.0070.00016.62
7.3.290.0100.00916.56
7.3.280.0100.00516.63
7.3.270.0100.01017.40
7.3.260.0140.01116.59
7.3.250.0090.00916.50
7.3.240.0080.00916.80
7.3.230.0040.01416.87
7.3.210.0140.00316.84
7.3.200.0090.00619.39
7.3.190.0110.00516.66
7.3.180.0100.00616.77
7.3.170.0110.00416.73
7.3.160.0130.00716.73
7.3.120.0060.01215.25
7.3.110.0040.01515.39
7.3.100.0050.00515.13
7.3.90.0070.00715.10
7.3.80.0000.01415.21
7.3.70.0060.00914.96
7.3.60.0130.00314.94
7.3.50.0090.00615.18
7.3.40.0080.00414.90
7.3.30.0110.00314.84
7.3.20.0030.00716.95
7.3.10.0040.00816.77
7.3.00.0080.00316.95
7.2.330.0090.00916.89
7.2.320.0080.00816.77
7.2.310.0040.01416.81
7.2.300.0130.00316.93
7.2.290.0000.01716.97
7.2.250.0080.01114.93
7.2.240.0070.01315.25
7.2.230.0000.01515.15
7.2.220.0100.00315.33
7.2.210.0090.00615.37
7.2.200.0040.01115.24
7.2.190.0060.01315.23
7.2.180.0080.00315.35
7.2.170.0030.01015.30
7.2.60.0030.01017.18
7.2.00.0070.00319.62
7.1.330.0040.01216.14
7.1.320.0060.00616.05
7.1.310.0070.00715.80
7.1.300.0090.00616.13
7.1.290.0050.00515.77
7.1.280.0090.00315.93
7.1.270.0030.01016.13
7.1.260.0000.01515.84
7.1.200.0000.01516.03
7.1.100.0070.00718.18
7.1.70.0050.00317.47
7.1.60.0110.01419.46
7.1.50.0070.01017.18
7.1.00.0030.07722.38
7.0.200.0000.01016.66
7.0.140.0000.07722.10
7.0.60.0000.04319.94
7.0.50.0070.07317.84
7.0.40.0170.03720.07
7.0.30.0500.08320.25
7.0.20.0270.08020.08
7.0.10.0130.08320.34
7.0.00.0070.04020.07
5.6.280.0030.07020.91
5.6.210.0030.04020.55
5.6.200.0170.07318.29
5.6.190.0170.07720.41
5.6.180.0430.08020.69
5.6.170.0230.08320.55
5.6.160.0030.04020.44
5.6.150.0070.08018.16
5.6.140.0030.03718.24
5.6.130.0070.08318.17
5.6.120.0100.08021.04
5.6.110.0030.04321.02
5.6.100.0100.08021.09
5.6.90.0100.08020.98
5.6.80.0200.05720.39
5.6.70.3270.03720.33
5.5.350.0170.08320.45
5.5.340.0070.06017.92
5.5.330.0100.07720.42
5.5.320.0300.03320.27
5.5.310.0370.06320.50
5.5.300.0130.05718.04
5.5.290.0100.06017.94
5.5.280.0070.05320.88
5.5.270.0070.04720.89
5.5.260.0100.05720.77
5.5.250.0100.08020.62
5.5.240.0130.06320.36
5.4.450.0500.05019.46
5.4.440.1400.05319.32
5.4.430.0270.03319.55
5.4.420.0270.04019.47
5.4.410.0500.03319.37
5.4.400.0630.03319.22
5.4.390.0370.04719.17
5.4.380.0270.06018.74
5.4.370.0600.06318.48
5.4.360.0430.04318.60
5.4.350.0430.05718.57
5.4.340.0330.06018.51
5.4.320.0070.03612.50
5.4.310.0040.04412.50
5.4.300.0080.03812.51
5.4.290.0060.03812.50
5.4.280.0050.04112.40
5.4.270.0030.03912.40
5.4.260.0060.03812.40
5.4.250.0120.05212.40
5.4.240.0100.03412.40
5.4.230.0060.03712.39
5.4.220.0050.03812.39
5.4.210.0090.03512.39
5.4.200.0080.03812.39
5.4.190.0060.03612.39
5.4.180.0020.03912.39
5.4.170.0060.03712.40
5.4.160.0070.03612.39
5.4.150.0060.04412.39
5.4.140.0040.03912.08
5.4.130.0060.03712.06
5.4.120.0050.04012.02
5.4.110.0030.03912.02
5.4.100.0050.03612.02
5.4.90.0050.03712.02
5.4.80.0060.03712.02
5.4.70.0050.03512.01
5.4.60.0050.03612.01
5.4.50.0030.03912.01
5.4.40.0070.03312.00
5.4.30.0050.03612.00
5.4.20.0040.03712.00
5.4.10.0060.03512.00
5.4.00.0070.03911.49
5.3.290.0060.04212.80
5.3.280.0060.03812.71
5.3.270.0040.04112.73
5.3.260.0040.04112.72
5.3.250.0060.03712.72
5.3.240.0050.04012.72
5.3.230.0030.04112.71
5.3.220.0060.03712.68
5.3.210.0040.04012.68
5.3.200.0060.03712.68
5.3.190.0060.03812.68
5.3.180.0070.03512.67
5.3.170.0080.03512.67
5.3.160.0060.03712.68
5.3.150.0060.03712.68
5.3.140.0030.03912.66
5.3.130.0060.03812.66
5.3.120.0090.03712.66
5.3.110.0070.03812.66
5.3.100.0090.03412.13
5.3.90.0060.03912.11
5.3.80.0050.03712.10
5.3.70.0050.03912.11
5.3.60.0060.03612.09
5.3.50.0110.04012.03
5.3.40.0070.03712.03
5.3.30.0110.03312.00
5.3.20.0060.03711.77
5.3.10.0060.03411.73
5.3.00.0060.03611.73
5.2.170.0050.0309.24
5.2.160.0070.0279.24
5.2.150.0020.0329.23
5.2.140.0040.0309.24
5.2.130.0050.0289.20
5.2.120.0050.0289.20
5.2.110.0040.0309.20
5.2.100.0070.0309.20
5.2.90.0020.0369.21
5.2.80.0040.0369.20
5.2.70.0040.0309.20
5.2.60.0050.0299.14
5.2.50.0040.0319.11
5.2.40.0060.0279.10
5.2.30.0030.0319.07
5.2.20.0020.0329.07
5.2.10.0060.0278.96
5.2.00.0040.0308.83
5.1.60.0100.0198.10
5.1.50.0080.0238.10
5.1.40.0070.0248.09
5.1.30.0050.0258.43
5.1.20.0060.0248.45
5.1.10.0040.0268.18
5.1.00.0030.0278.18
5.0.50.0040.0206.66
5.0.40.0050.0186.52
5.0.30.0040.0366.33
5.0.20.0050.0216.30
5.0.10.0050.0196.28
5.0.00.0010.0336.28
4.4.90.0040.0164.78
4.4.80.0030.0154.75
4.4.70.0020.0164.76
4.4.60.0010.0164.76
4.4.50.0020.0164.77
4.4.40.0040.0234.71
4.4.30.0030.0154.75
4.4.20.0030.0154.84
4.4.10.0030.0164.85
4.4.00.0020.0274.76
4.3.110.0040.0184.67
4.3.100.0050.0134.66
4.3.90.0050.0124.63
4.3.80.0040.0244.58
4.3.70.0010.0174.63
4.3.60.0030.0144.63
4.3.50.0020.0164.62
4.3.40.0030.0244.54
4.3.30.0020.0163.30
4.3.20.0020.0173.28
4.3.10.0030.0163.24
4.3.00.0000.02015.69

preferences:
52.65 ms | 401 KiB | 5 Q