3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public const PATH_TO_FILES = __DIR_.'../dpm/oc-content/uploads/28/'; public function __construct() { $item = $this->itemResolver(); $imageThumbNailsPath = []; $imagePreviewPath = []; foreach(iterator_to_array($item,true) as $field){ $thumbNailsPath = sprintf('%s_thumbnail.jpg',$field[0]); $previewsPath = sprintf('%s__preview.jpg',$field[0]); $imageThumbNailsPath[] = sprintf('%s%s',self::PATH_TO_FILES,$thumbNailsPath); $imagePreviewPath[] = sprintf('%s%s',self::PATH_TO_FILES,$previewsPath); } var_dump($imagePreviewPath); var_dump($imageThumbNailsPath); } public function itemResolver(): \Generator { // $stmt = mysqli_query($db_connect, "select pk_i_id from oc_t_item_resource ORDER by pk_i_id desc"); // $records = mysqli_fetch_all($stmt); $records = [ 0 => [0 => '4031'], 1 => [0 => '4030'], 2 => [0 => '4029'] ]; foreach($records as $record => $value){ yield $value; } } } var_dump(new Test());

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.0110.00718.56
8.3.50.0120.00318.17
8.3.40.0100.01018.56
8.3.30.0180.00418.66
8.3.20.0070.00019.16
8.3.10.0090.00021.65
8.3.00.0080.00020.50
8.2.180.0070.00718.54
8.2.170.0130.00322.96
8.2.160.0030.01020.38
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00217.75
8.2.120.0040.00426.35
8.2.110.0060.00322.25
8.2.100.0130.00317.66
8.2.90.0000.00817.75
8.2.80.0030.00518.72
8.2.70.0000.00817.38
8.2.60.0060.00317.75
8.2.50.0110.00018.04
8.2.40.0000.00918.03
8.2.30.0040.00419.18
8.2.20.0060.00617.82
8.2.10.0000.00718.00
8.2.00.0000.00817.71
8.1.280.0150.00425.92
8.1.270.0040.00418.93
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0090.00323.79
8.1.230.0040.00720.91
8.1.220.0040.00418.44
8.1.210.0000.00818.77
8.1.200.0030.00517.22
8.1.190.0030.00617.10
8.1.180.0040.00418.10
8.1.170.0040.00417.62
8.1.160.0030.00318.66
8.1.150.0040.00418.64
8.1.140.0050.00222.14
8.1.130.0000.00620.30
8.1.120.0000.00817.39
8.1.110.0050.00217.36
8.1.100.0040.00417.34
8.1.90.0040.00417.23
8.1.80.0050.00217.34
8.1.70.0000.00817.34
8.1.60.0050.00317.46
8.1.50.0030.00617.48
8.1.40.0000.00817.49
8.1.30.0060.00617.54
8.1.20.0040.00717.54
8.1.10.0030.00617.55
8.1.00.0040.00417.33
8.0.300.0040.00418.77
8.0.290.0040.00416.93
8.0.280.0000.00718.38
8.0.270.0070.00017.18
8.0.260.0000.00718.32
8.0.250.0050.00316.96
8.0.240.0030.00317.00
8.0.230.0070.00016.93
8.0.220.0000.00716.95
8.0.210.0000.00716.88
8.0.200.0040.00416.93
8.0.190.0080.00016.86
8.0.180.0000.00716.80
8.0.170.0030.00516.91
8.0.160.0050.00216.78
8.0.150.0000.01016.79
8.0.140.0000.00716.71
8.0.130.0050.00013.35
8.0.120.0000.00816.75
8.0.110.0030.00516.88
8.0.100.0000.00716.76
8.0.90.0040.00416.72
8.0.80.0060.00916.92
8.0.70.0080.00016.84
8.0.60.0060.00316.76
8.0.50.0040.00416.95
8.0.30.0110.00616.87
8.0.20.0050.01417.40
8.0.10.0000.00817.06
8.0.00.0060.01316.67
7.4.330.0000.00515.55
7.4.320.0000.00616.64
7.4.300.0030.00316.59
7.4.290.0000.00716.61
7.4.280.0080.00016.50
7.4.270.0030.00316.59
7.4.260.0000.00716.65
7.4.250.0000.01016.45
7.4.240.0030.00316.52
7.4.230.0080.00016.58
7.4.220.0000.00816.53
7.4.210.0110.00716.60
7.4.200.0000.00716.57
7.4.160.0060.01016.47
7.4.140.0090.01217.86
7.4.130.0100.01016.52
7.4.120.0110.00816.49
7.4.110.0170.00316.56
7.4.100.0140.00316.44
7.4.90.0100.00716.56
7.4.80.0110.00819.39
7.4.70.0110.00516.41
7.4.60.0040.01216.49
7.4.50.0060.00616.33
7.4.40.0080.00816.36
7.4.00.0050.00914.80
7.3.330.0000.00513.29
7.3.320.0040.00413.43
7.3.310.0080.00016.28
7.3.300.0070.00016.44
7.3.290.0040.00416.28
7.3.280.0110.00716.46
7.3.260.0070.01316.47
7.3.240.0100.01016.46
7.3.230.0100.01316.43
7.3.210.0030.01416.45
7.3.200.0110.00616.55
7.3.190.0090.00916.46
7.3.180.0090.00616.53
7.3.170.0030.01416.45
7.3.160.0120.00316.43
7.3.120.0070.01115.14
7.3.110.0090.00914.99
7.3.100.0090.00414.90
7.3.90.0040.01114.86
7.3.80.0040.01115.07
7.3.70.0030.00814.46
7.3.60.0000.01014.89
7.3.50.0040.01214.86
7.3.40.0000.01115.01
7.3.30.0030.01414.62
7.3.20.0050.00816.85
7.3.10.0090.00316.86
7.3.00.0070.00416.73
7.2.330.0090.00916.50
7.2.320.0150.00316.75
7.2.310.0060.01216.89
7.2.300.0030.01316.80
7.2.290.0040.01416.77
7.2.250.0070.01015.00
7.2.240.0070.01115.30
7.2.230.0040.01415.08
7.2.220.0090.00914.89
7.2.210.0070.01015.15
7.2.200.0000.01114.88
7.2.190.0060.01015.17
7.2.180.0060.00315.31
7.2.170.0030.00615.20
7.2.110.1130.00614.79
7.2.100.0660.00714.70
7.2.90.1180.00614.87
7.2.80.0650.00814.73
7.2.70.0270.01015.06
7.2.60.1130.00614.90
7.2.50.1020.01314.84
7.2.40.0360.01314.58
7.2.30.0790.00715.26
7.2.20.1210.00015.06
7.2.10.0630.00915.11
7.2.00.1220.00014.51
7.1.330.0120.00315.97
7.1.320.0070.01015.79
7.1.310.0070.00715.70
7.1.300.0000.01515.89
7.1.290.0030.01415.81
7.1.280.0130.00015.80
7.1.270.0070.00716.02
7.1.260.0030.01015.86
7.1.230.1100.00013.95
7.1.220.1270.00314.05
7.1.210.0770.00413.71
7.1.200.0670.01013.59
7.1.190.1200.00313.71
7.1.180.0180.00914.13
7.1.170.0370.00613.70
7.1.160.0710.00613.56
7.1.150.0260.00713.94
7.1.140.0910.00313.99
7.1.130.0670.01314.00
7.1.120.0760.00714.01
7.1.110.0830.01014.08
7.1.100.0700.00913.86
7.1.90.0690.00313.91
7.1.80.0660.00714.02
7.1.70.0640.01014.05
7.1.60.0730.02131.82
7.1.50.1180.00632.00
7.1.40.0320.01432.00
7.1.30.0740.01031.52
7.1.20.1150.01031.58
7.1.10.1350.00313.64
7.1.00.0220.00313.59
5.6.380.0130.00714.29

preferences:
59.04 ms | 401 KiB | 5 Q