3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array ( array ( 'UserID' => '5GDPR6LR', 'BatchID' => '1', 'BatchItemID' => '1', 'Categories' => '["1","2"]', 'UserComment' => 'first comment', ) , array ( 'UserID' => '5GDPR6LR', 'BatchID' => '1', 'BatchItemID' => '2', 'Categories' => '["3","4"]', 'UserComment' => 'second comment', ) , array ( 'UserID' => '5GDPR6LR', 'BatchID' => '1', 'BatchItemID' => '3', 'Categories' => '["5","6"]', 'UserComment' => 'third comment', ) , ); $headers = array_keys($data[0]); echo '<pre>ARRAY TO WRITE TO FILE:<br>'; print_r($data); echo '</pre><hr>'; $responseFile = '/tmp/12'; $fp = fopen($responseFile, 'w'); fputcsv($fp, $headers, ",", "\"", "\\", "\n"); $lastrow = array(); foreach ($data as $row) { echo '<pre>LASTROW:'; print_r($lastrow); echo '</pre>'; echo '<pre>THISROW:'; print_r($row); echo '</pre>'; if ($row !== $lastrow) { fputcsv($fp, $row, ",", "\"", "\\", "\n"); echo '<pre>ROW WRITTEN TO CSV:'; print_r($row); echo '</pre>'; } $lastrow = $row; } fclose($fp); echo "\n".file_get_contents('/tmp/12') ?>

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.5.00.0140.00720.16
8.4.150.0070.00617.81
8.4.140.0130.00917.73
8.4.130.0110.00919.42
8.4.120.0130.00720.69
8.4.110.0400.01117.69
8.4.100.0340.00917.82
8.4.90.0190.00417.89
8.4.80.0400.00917.50
8.4.70.0430.00718.00
8.4.60.0410.01117.59
8.4.50.0340.00717.72
8.4.40.0440.00717.07
8.4.30.0440.00717.16
8.4.20.0210.00617.10
8.4.10.0220.00517.25
8.3.280.0020.00014.05
8.3.270.0130.00716.64
8.3.260.0130.00716.54
8.3.250.0120.00817.17
8.3.240.0270.00817.13
8.3.230.0460.00416.50
8.3.220.0460.00516.38
8.3.210.0290.00416.72
8.3.200.0240.00416.62
8.3.190.0140.00716.48
8.3.180.0290.00716.50
8.3.170.0230.00316.34
8.3.160.0380.01116.44
8.3.150.0400.01016.27
8.3.140.0320.00816.72
8.3.130.0410.00816.77
8.3.120.0410.00516.55
8.3.110.0390.00816.77
8.3.100.0390.00516.55
8.3.90.0440.00716.63
8.3.80.0420.00916.48
8.3.70.0350.00916.82
8.3.60.0490.00316.46
8.3.50.0430.01116.16
8.3.40.0430.00817.72
8.3.30.0350.00617.55
8.3.20.0320.00917.36
8.3.10.0300.00617.48
8.3.00.0240.00417.65
8.2.290.0100.00816.52
8.2.280.0360.00916.53
8.2.270.0230.00616.81
8.2.260.0310.00516.44
8.2.250.0300.00416.54
8.2.240.0360.00616.48
8.2.230.0380.01016.48
8.2.220.0340.00616.65
8.2.210.0210.00516.36
8.2.200.0340.00616.21
8.2.190.0330.00916.44
8.2.180.0330.00916.70
8.2.170.0280.00417.89
8.2.160.0210.00417.65
8.2.150.0390.00617.45
8.2.140.0360.00917.53
8.2.130.0370.00917.51
8.2.120.0350.01117.56
8.2.110.0350.01217.72
8.2.100.0320.01217.51
8.2.90.0310.00917.64
8.2.80.0200.00517.68
8.2.70.0250.00517.26
8.2.60.0350.00617.43
8.2.50.0490.00717.46
8.2.40.0380.00617.36
8.2.30.0200.00417.63
8.2.20.0160.00217.62
8.2.10.0380.00617.63
8.2.00.0260.00617.62

preferences:
56.05 ms | 403 KiB | 5 Q