3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data=array(array('name'=>'ahmed','job'=>'engineer','age'=>25,'hobbies'=>array('drawing','swimming','reading'),'skills'=>array('coding','fasting learning','teaching')),array('name'=>'Sara','job'=>'designer','age'=>19,'skills'=>array('fast learning')),array('name'=>'Ali','age'=>25,'city'=>'cairo'),array('name'=>'Hossam','job'=>'accountant','age'=>25,'city'=>'zagazig'),array('name'=>'Esraa','job'=>'Designer','age'=>23,'city'=>'zagazig','hobbies'=>array('writing','reading'),'skills'=>array('coding','teaching')),); $search_string = 'zagazig'; $results = array(); foreach($data as $value) { if( !empty($value['city']) && (stripos($value['city'], $search_string) !== false) ) { $results[] = $value; } } if(!empty($results)) { echo 'Number of results: ' , count($results), PHP_EOL, ' Result ', PHP_EOL; foreach($results as $r) { echo " Name: {$r['name']} Job: {$r['job']} Age: {$r['age']} ", PHP_EOL; echo !empty($r['hobbies']) ? PHP_EOL . 'Hobbies: ' . PHP_EOL . implode(PHP_EOL, $r['hobbies']) : ''; } }

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.0170.00316.63
8.3.50.0190.00318.17
8.3.40.0110.01118.79
8.3.30.0070.00718.89
8.3.20.0000.00819.20
8.3.10.0080.00021.73
8.3.00.0050.00222.51
8.2.180.0140.00416.50
8.2.170.0070.00722.96
8.2.160.0100.00320.97
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0070.00022.25
8.2.120.0080.00026.35
8.2.110.0060.00320.94
8.2.100.0110.00017.91
8.2.90.0000.00819.27
8.2.80.0030.00517.97
8.2.70.0000.01017.63
8.2.60.0060.00317.68
8.2.50.0060.00318.10
8.2.40.0000.00822.32
8.2.30.0080.00019.34
8.2.20.0000.00717.65
8.2.10.0000.00817.96
8.2.00.0050.00317.92
8.1.280.0070.01125.92
8.1.270.0070.00024.02
8.1.260.0060.00328.09
8.1.250.0080.00028.09
8.1.240.0070.00321.37
8.1.230.0060.00617.42
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0080.00317.23
8.1.190.0040.00417.22
8.1.180.0000.00918.10
8.1.170.0030.00518.64
8.1.160.0030.00322.01
8.1.150.0030.00618.86
8.1.140.0040.00419.44
8.1.130.0000.00717.80
8.1.120.0040.00417.52
8.1.110.0000.00817.36
8.1.100.0070.00017.45
8.1.90.0000.00817.34
8.1.80.0040.00417.46
8.1.70.0040.00417.45
8.1.60.0090.00017.48
8.1.50.0000.00817.39
8.1.40.0000.00817.56
8.1.30.0060.00317.49
8.1.20.0050.00317.60
8.1.10.0040.00417.47
8.1.00.0030.00517.39
8.0.300.0080.00018.77
8.0.290.0040.00416.63
8.0.280.0030.00318.39
8.0.270.0070.00017.26
8.0.260.0070.00017.22
8.0.250.0000.00817.01
8.0.240.0080.00016.86
8.0.230.0030.00316.82
8.0.220.0040.00416.88
8.0.210.0000.00716.92
8.0.200.0070.00016.92
8.0.190.0000.00816.95
8.0.180.0030.00316.96
8.0.170.0050.00316.84
8.0.160.0040.00416.97
8.0.150.0050.00316.73
8.0.140.0000.00816.85
8.0.130.0030.00313.31
8.0.120.0040.00416.88
8.0.110.0040.00416.72
8.0.100.0070.00016.75
8.0.90.0070.00016.78
8.0.80.0060.01316.93
8.0.70.0050.00516.91
8.0.60.0000.00716.68
8.0.50.0030.00616.87
8.0.30.0090.01017.27
8.0.20.0100.00817.40
8.0.10.0000.00716.86
8.0.00.0130.01016.74
7.4.330.0050.00015.08
7.4.320.0070.00016.48
7.4.300.0000.00616.63
7.4.290.0000.00716.50
7.4.280.0040.00416.56
7.4.270.0030.00316.51
7.4.260.0070.00016.50
7.4.250.0030.00316.59
7.4.240.0040.00416.43
7.4.230.0030.00316.63
7.4.220.0130.01316.55
7.4.210.0080.00816.57
7.4.200.0030.00316.39
7.4.160.0080.00816.33
7.4.150.0070.01017.40
7.4.140.0080.00917.86
7.4.130.0090.00816.56
7.4.120.0060.01216.58
7.4.110.0100.01316.40
7.4.100.0100.00716.26
7.4.90.0090.01216.43
7.4.80.0080.00819.39
7.4.70.0100.00516.44
7.4.60.0100.00716.47
7.4.50.0060.00916.43
7.4.40.0060.01016.54
7.4.30.0030.01316.52
7.4.00.0030.01314.89
7.3.330.0000.00513.26
7.3.320.0000.00513.25
7.3.310.0030.00616.36
7.3.300.0030.00316.21
7.3.290.0030.00316.26
7.3.280.0080.00816.24
7.3.270.0130.00317.40
7.3.260.0090.00916.48
7.3.250.0110.00616.32
7.3.240.0030.01516.38
7.3.230.0030.01316.57
7.3.210.0140.00316.66
7.3.200.0190.00316.33
7.3.190.0100.00716.44
7.3.180.0090.00916.46
7.3.170.0150.00616.34
7.3.160.0030.01316.54
7.3.120.0090.00915.07
7.3.110.0070.01015.10
7.3.100.0080.00814.81
7.3.90.0030.01414.77
7.3.80.0000.01414.95
7.3.70.0060.00614.70
7.3.60.0030.00914.76
7.3.50.0120.00314.95
7.3.40.0030.00614.67
7.3.30.0070.00714.99
7.3.20.0040.01116.57
7.3.10.0030.01216.39
7.3.00.0090.00616.61
7.2.330.0090.00816.55
7.2.320.0170.00316.54
7.2.310.0070.01316.66
7.2.300.0100.00716.89
7.2.290.0090.00816.77
7.2.250.0080.00815.18
7.2.240.0100.01015.11
7.2.230.0040.00815.18
7.2.220.0000.01315.27
7.2.210.0030.01015.04
7.2.200.0000.01014.95
7.2.190.0100.00315.22
7.2.180.0030.01014.99
7.2.170.0120.00414.95
7.2.60.0060.00916.87
7.2.00.0060.00919.63
7.1.330.0060.00615.75
7.1.320.0030.00816.10
7.1.310.0080.00015.85
7.1.300.0060.00615.67
7.1.290.0120.00015.93
7.1.280.0030.01015.89
7.1.270.0040.01115.80
7.1.260.0030.01015.88
7.1.200.0060.00615.55
7.1.100.0060.00618.22
7.1.70.0000.00817.12
7.1.60.0000.01217.26
7.1.00.0030.07722.42
7.0.200.0130.00014.83
7.0.100.1730.08320.05
7.0.90.1600.06719.98
7.0.80.1530.04720.18
7.0.70.0100.06719.97
7.0.60.0170.05320.01
7.0.50.1600.05320.43
7.0.40.1300.07020.35
7.0.30.2470.05020.33
7.0.20.1400.07320.24
7.0.10.0800.08720.36
7.0.00.2070.05320.39
5.6.250.0070.06320.78
5.6.240.0130.06020.65
5.6.230.0100.06020.61
5.6.220.0170.05320.66
5.6.210.0100.06020.76
5.6.200.0130.06021.10
5.6.190.0130.07721.03
5.6.180.0170.05321.09
5.6.170.0030.06721.09
5.6.160.0170.07321.07
5.6.150.0070.07021.03
5.6.140.0200.05321.18
5.6.130.0230.04721.09
5.6.120.0170.05721.11
5.6.110.0230.05321.02
5.6.100.0230.05321.02
5.6.90.0200.06021.07
5.6.80.0170.07020.54
5.6.70.0070.06020.46
5.6.60.0100.06020.43
5.6.50.0130.07720.46
5.6.40.0130.07720.39
5.6.30.0070.06020.54
5.6.20.0070.06020.54
5.6.10.0130.05320.47
5.6.00.0200.05720.48

preferences:
62.49 ms | 400 KiB | 5 Q