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_map($input, "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.0120.00616.75
8.3.50.0080.01322.90
8.3.40.0090.00618.92
8.3.30.0140.00019.17
8.3.20.0000.00820.20
8.3.10.0040.00423.53
8.3.00.0090.00019.76
8.2.180.0040.01118.54
8.2.170.0060.01519.09
8.2.160.0100.00322.96
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00420.83
8.2.110.0060.00322.29
8.2.100.0080.00417.97
8.2.90.0000.00819.26
8.2.80.0030.00618.00
8.2.70.0060.00617.50
8.2.60.0000.00817.90
8.2.50.0030.00618.07
8.2.40.0000.00818.09
8.2.30.0040.00418.10
8.2.20.0080.00017.86
8.2.10.0080.00018.16
8.2.00.0040.00417.87
8.1.280.0100.01025.92
8.1.270.0050.00323.77
8.1.260.0000.00726.35
8.1.250.0050.00228.09
8.1.240.0000.00921.84
8.1.230.0070.00319.09
8.1.220.0080.00017.79
8.1.210.0000.00818.77
8.1.200.0000.01217.47
8.1.190.0040.00417.35
8.1.180.0060.00318.10
8.1.170.0030.00618.84
8.1.160.0000.00722.05
8.1.150.0030.00618.98
8.1.140.0030.00617.68
8.1.130.0070.00017.79
8.1.120.0080.00017.52
8.1.110.0000.00717.60
8.1.100.0000.00717.67
8.1.90.0000.00717.56
8.1.80.0050.00317.51
8.1.70.0040.00417.63
8.1.60.0030.00617.82
8.1.50.0080.00017.75
8.1.40.0000.00817.67
8.1.30.0000.00917.59
8.1.20.0050.00317.71
8.1.10.0000.00817.69
8.1.00.0090.00017.68
8.0.300.0000.00718.77
8.0.290.0070.00017.00
8.0.280.0040.00418.49
8.0.270.0070.00017.17
8.0.260.0000.00617.29
8.0.250.0070.00017.20
8.0.240.0040.00417.07
8.0.230.0000.00717.14
8.0.220.0070.00017.14
8.0.210.0040.00417.02
8.0.200.0060.00017.18
8.0.190.0030.00517.18
8.0.180.0030.00617.16
8.0.170.0040.00417.16
8.0.160.0040.00417.06
8.0.150.0080.00017.00
8.0.140.0030.00517.00
8.0.130.0030.00413.57
8.0.120.0030.00617.14
8.0.110.0080.00017.08
8.0.100.0000.00816.94
8.0.90.0000.00817.00
8.0.80.0130.00717.09
8.0.70.0060.00316.94
8.0.60.0040.00416.96
8.0.50.0080.00017.03
8.0.30.0160.00617.29
8.0.20.0120.00617.40
8.0.10.0080.00017.35
8.0.00.0080.00916.98
7.4.330.0000.00615.02
7.4.320.0000.00716.84
7.4.300.0000.00716.71
7.4.290.0040.00416.63
7.4.280.0040.00416.82
7.4.270.0000.00716.64
7.4.260.0040.00416.83
7.4.250.0070.00016.82
7.4.240.0010.00716.74
7.4.230.0030.00316.85
7.4.220.0120.01516.74
7.4.210.0100.00316.84
7.4.200.0050.00316.80
7.4.160.0160.00016.66
7.4.150.0090.00917.40
7.4.140.0090.00817.86
7.4.130.0130.00616.86
7.4.120.0110.00716.78
7.4.110.0110.00716.78
7.4.100.0170.00716.82
7.4.90.0040.01416.60
7.4.80.0060.01219.39
7.4.70.0100.00716.61
7.4.60.0030.01316.80
7.4.50.0050.00216.79
7.4.40.0060.01316.84
7.4.30.0090.00916.80
7.4.00.0070.01015.27
7.3.330.0060.00013.55
7.3.320.0050.00013.57
7.3.310.0000.00716.59
7.3.300.0000.00716.48
7.3.290.0090.00916.60
7.3.280.0070.01016.56
7.3.270.0200.00317.40
7.3.260.0090.00916.82
7.3.250.0110.00716.72
7.3.240.0070.01016.63
7.3.230.0080.00816.48
7.3.210.0150.00316.54
7.3.200.0110.00619.39
7.3.190.0080.00816.59
7.3.180.0170.00316.81
7.3.170.0130.00316.54
7.3.160.0080.00816.55
7.2.330.0120.00617.03
7.2.320.0060.01416.90
7.2.310.0160.00316.88
7.2.300.0100.00716.71
7.2.290.0110.00616.69
7.2.00.0040.00419.77
7.1.100.0000.01218.41
7.1.70.0020.00517.31
7.1.60.0100.01619.46
7.1.50.0070.01616.84
7.1.00.0030.07722.49
7.0.200.0080.00417.00
7.0.140.0070.07321.97
7.0.60.0070.03720.05
7.0.50.0070.07017.87
7.0.40.0070.09020.29
7.0.30.0200.05020.17
7.0.20.0330.07720.24
7.0.10.0070.08320.07
7.0.00.0000.04720.16
5.6.280.0100.06720.79
5.6.210.0100.07320.57
5.6.200.0130.07718.19
5.6.190.0170.07320.62
5.6.180.0000.06720.49
5.6.170.0130.04720.55
5.6.160.0100.08020.51
5.6.150.0130.03718.25
5.6.140.0070.07018.11
5.6.130.0070.08018.14
5.6.120.0100.06321.10
5.6.110.0070.08321.05
5.6.100.0100.06021.04
5.6.90.0070.08720.89
5.6.80.0130.06320.51
5.6.70.3970.04720.37
5.5.350.0100.08020.34
5.5.340.0030.04017.95
5.5.330.0070.07020.43
5.5.320.0370.07720.41
5.5.310.0330.07020.23
5.5.300.0000.08717.95
5.5.290.0230.05017.98
5.5.280.0030.05320.85
5.5.270.0100.08320.74
5.5.260.0130.08020.87
5.5.250.0070.08320.80
5.5.240.0170.07020.24
5.4.450.0200.03719.31
5.4.440.0330.04019.52
5.4.430.0370.03719.57
5.4.420.0130.04319.21
5.4.410.0270.03719.45
5.4.400.0130.04719.32
5.4.390.0470.03718.87
5.4.380.0330.05018.54
5.4.370.0430.04318.46
5.4.360.0230.05718.83
5.4.350.0270.06018.53
5.4.340.0400.04718.61
5.4.320.0110.03112.50
5.4.310.0050.03912.50
5.4.300.0080.03612.51
5.4.290.0050.04012.50
5.4.280.0070.03512.40
5.4.270.0110.04412.40
5.4.260.0070.03612.40
5.4.250.0060.03712.40
5.4.240.0080.03312.39
5.4.230.0070.03712.39
5.4.220.0060.03612.39
5.4.210.0070.03412.39
5.4.200.0050.03812.39
5.4.190.0070.03512.38
5.4.180.0110.04212.39
5.4.170.0040.03912.40
5.4.160.0070.03612.39
5.4.150.0020.04112.39
5.4.140.0090.03412.07
5.4.130.0030.03912.07
5.4.120.0060.03612.02
5.4.110.0070.03412.02
5.4.100.0070.03412.01
5.4.90.0050.03812.02
5.4.80.0030.03912.02
5.4.70.0060.03512.01
5.4.60.0060.03412.01
5.4.50.0080.03412.01
5.4.40.0060.04312.00
5.4.30.0040.03612.00
5.4.20.0040.03812.00
5.4.10.0030.03711.99
5.4.00.0080.03311.49
5.3.290.0050.04112.80
5.3.280.0070.03712.71
5.3.270.0060.03912.72
5.3.260.0070.03712.72
5.3.250.0060.03712.72
5.3.240.0060.03612.72
5.3.230.0100.03612.71
5.3.220.0110.03212.68
5.3.210.0140.03112.68
5.3.200.0090.03212.68
5.3.190.0110.03312.68
5.3.180.0040.03912.67
5.3.170.0070.03512.67
5.3.160.0060.03812.68
5.3.150.0080.03812.67
5.3.140.0130.03012.66
5.3.130.0090.03612.66
5.3.120.0060.03912.66
5.3.110.0090.04212.66
5.3.100.0070.03612.12
5.3.90.0070.03612.10
5.3.80.0060.03712.09
5.3.70.0070.03712.09
5.3.60.0090.03312.08
5.3.50.0050.03712.03
5.3.40.0050.03812.03
5.3.30.0070.03411.99
5.3.20.0050.03611.77
5.3.10.0070.03611.73
5.3.00.0040.04111.72
5.2.170.0040.0319.24
5.2.160.0130.0239.23
5.2.150.0090.0359.23
5.2.140.0090.0279.23
5.2.130.0060.0359.20
5.2.120.0030.0319.19
5.2.110.0060.0279.20
5.2.100.0040.0299.20
5.2.90.0070.0289.20
5.2.80.0050.0299.19
5.2.70.0030.0329.20
5.2.60.0050.0309.14
5.2.50.0030.0319.11
5.2.40.0040.0299.09
5.2.30.0030.0329.07
5.2.20.0030.0319.07
5.2.10.0030.0308.96
5.2.00.0050.0298.83
5.1.60.0050.0268.10
5.1.50.0050.0238.10
5.1.40.0060.0228.08
5.1.30.0030.0278.43
5.1.20.0050.0268.46
5.1.10.0060.0248.18
5.1.00.0060.0248.18
5.0.50.0060.0186.66
5.0.40.0030.0196.52
5.0.30.0040.0316.34
5.0.20.0030.0206.30
5.0.10.0050.0186.28
5.0.00.0040.0296.27
4.4.90.0000.0184.78
4.4.80.0020.0174.75
4.4.70.0020.0194.75
4.4.60.0040.0164.75
4.4.50.0030.0154.77
4.4.40.0050.0254.71
4.4.30.0020.0164.76
4.4.20.0010.0194.85
4.4.10.0030.0154.85
4.4.00.0020.0284.76
4.3.110.0030.0154.67
4.3.100.0030.0144.66
4.3.90.0020.0154.64
4.3.80.0010.0264.59
4.3.70.0020.0154.63
4.3.60.0020.0154.63
4.3.50.0040.0144.62
4.3.40.0040.0234.54
4.3.30.0030.0153.30
4.3.20.0020.0163.28
4.3.10.0030.0143.23
4.3.00.0030.01715.69

preferences:
41.38 ms | 401 KiB | 5 Q