3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = json_decode('{"creditor_trans_id":"655354-1","invoices":[{"id":"111333","date_created":"2015-06-02T00:00:00","payment_due":"2015-06-15T00:00:00","currency":"PLN","total":"45000","left_to_pay":"40000"}],"attachments":[{"id":"586a84aa-1b41-11e5-91d6-0cc47a41af63","name":"test324794_256.bmp","size":10002,"thumbnailUrl":null,"type":"image\/x-ms-bmp","expires":"2015-06-26T01:51:57+02:00","_links":{"self":{"href":"http:\/\/api.transinkasso.eu\/api\/rest\/debt-attachment\/586a84aa-1b41-11e5-91d6-0cc47a41af63"}}},{"id":"586b2f8c-1b41-11e5-91d6-0cc47a41af63","name":"tif_test.tif","size":26144,"thumbnailUrl":null,"type":"image\/tiff","expires":"2015-06-26T01:51:57+02:00","_links":{"self":{"href":"http:\/\/api.transinkasso.eu\/api\/rest\/debt-attachment\/586b2f8c-1b41-11e5-91d6-0cc47a41af63"}}},{"id":"586b9033-1b41-11e5-91d6-0cc47a41af63","name":"test324794.bmp","size":26438,"thumbnailUrl":null,"type":"image\/x-ms-bmp","expires":"2015-06-26T01:51:57+02:00","_links":{"self":{"href":"http:\/\/api.transinkasso.eu\/api\/rest\/debt-attachment\/586b9033-1b41-11e5-91d6-0cc47a41af63"}}},{"id":"586d3a17-1b41-11e5-91d6-0cc47a41af63","name":"test324794.png","size":24989,"thumbnailUrl":null,"type":"image\/png","expires":"2015-06-26T01:51:57+02:00","_links":{"self":{"href":"http:\/\/api.transinkasso.eu\/api\/rest\/debt-attachment\/586d3a17-1b41-11e5-91d6-0cc47a41af63"}}},{"id":"5879e073-1b41-11e5-91d6-0cc47a41af63","name":"Rotating_earth_(large).gif","size":316029,"thumbnailUrl":null,"type":"image\/gif","expires":"2015-06-26T01:51:57+02:00","_links":{"self":{"href":"http:\/\/api.transinkasso.eu\/api\/rest\/debt-attachment\/5879e073-1b41-11e5-91d6-0cc47a41af63"}}}],"debtor_company":{"country":"PL","vat_id":"1112223334","name":"RST test12 15 51","email":"test1@truckx.eu","phone":"1234567","city":"Wroc\u0142aw","postal_code":"21-222","address":"chabrowa 4 kilka plikow 5 do 1mb"}} | completed | 2015-06-25 15:52:16 | 2015-06-25 15:52:16 || 41 | {"creditor_trans_id":"655354-1","invoices":[{"id":"1111444","date_created":"2015-06-01T00:00:00","payment_due":"2015-06-22T00:00:00","currency":"PLN","total":"55555","left_to_pay":"9000"},{"id":"2222555","date_created":"2015-06-02T00:00:00","payment_due":"2015-06-23T00:00:00","currency":"PLN","total":"600","left_to_pay":"60"}],"attachments":[],"debtor_company":{"country":"PL","vat_id":"1112223334","name":"RST test12 15 52","email":"test1@truckx.eu","phone":"1234567","city":"Wroclaw","postal_code":"21-222","address":"chabrowa 4 kilka faktur bez plikow 1 waluta"}}', true); $data = [ 'transId' => $content['creditor_trans_id'], 'debtorCompany' => [ 'nip' => $content['debtor_company']['vat_id'], 'zipCode' => $content['debtor_company']['postal_code'], 'city' => $content['debtor_company']['city'], 'name' => $content['debtor_company']['name'], 'address' => $content['debtor_company']['address'], 'countryCode' => $content['debtor_company']['country'], 'email' => empty($content['debtor_company']['email']) ? null : $content['debtor_company']['email'], 'phone' => empty($content['debtor_company']['phone']) ? null : preg_replace('/[^0-9]/', '', $content['debtor_company']['phone']), ], 'invoices' => $content['invoices'], 'attachments' => $content['attachments'], ]; $content = $data; $content['debts'] = []; foreach ($content['invoices'] as $invoice) { $key = false; if ($content['debts']) { $key = array_search($invoice['currency'], array_column($content['debts'], 'currency')); } if ($key !== false) { $content['debts'][$key]['total'] = bcadd($content['debts'][$key]['total'], $invoice['total'], 2); $content['debts'][$key]['invoices'][] = $invoice; } else { $content['debts'][] = [ 'id' => 0, 'debtReportId' => 0, 'currency' => $invoice['currency'], 'total' => $invoice['total'], 'dateCreated' => null, 'invoices' => [ [ 'id' => 0, 'number' => $invoice['id'], 'issueDate' => $invoice['date_created'], 'paymentDate' => $invoice['payment_due'], 'total' => $invoice['total'], 'leftToPay' => $invoice['left_to_pay'], ] ], ]; } } unset($content['invoices']); echo json_encode($content);

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.0150.00018.48
8.3.50.0110.00922.98
8.3.40.0030.01618.96
8.3.30.0140.00719.00
8.3.20.0070.00020.21
8.3.10.0080.00023.52
8.3.00.0040.00419.17
8.2.180.0070.00718.29
8.2.170.0070.00718.89
8.2.160.0100.00722.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0030.00626.16
8.2.120.0050.00319.36
8.2.110.0030.00621.89
8.2.100.0110.00017.78
8.2.90.0050.00319.17
8.2.80.0030.00519.31
8.2.70.0040.00417.48
8.2.60.0040.00418.03
8.2.50.0000.00818.07
8.2.40.0060.00318.22
8.2.30.0020.00519.43
8.2.20.0040.00417.85
8.2.10.0000.00819.85
8.2.00.0000.00719.81
8.1.280.0040.01125.92
8.1.270.0050.00320.43
8.1.260.0110.00426.35
8.1.250.0060.00328.09
8.1.240.0040.00422.18
8.1.230.0040.00819.00
8.1.220.0000.00817.74
8.1.210.0050.00518.77
8.1.200.0040.00417.35
8.1.190.0040.00417.43
8.1.180.0060.00318.91
8.1.170.0050.00318.53
8.1.160.0000.00818.89
8.1.150.0040.00418.80
8.1.140.0040.00417.50
8.1.130.0080.00017.78
8.1.120.0020.00517.48
8.1.110.0080.00017.41
8.1.100.0000.00817.41
8.1.90.0040.00417.46
8.1.80.0000.00817.36
8.1.70.0000.00717.47
8.1.60.0030.00617.55
8.1.50.0080.00017.58
8.1.40.0030.00517.50
8.1.30.0050.00317.68
8.1.20.0040.00417.70
8.1.10.0030.00617.54
8.1.00.0080.00317.52
8.0.300.0080.00018.77
8.0.290.0070.00017.30
8.0.280.0040.00418.38
8.0.270.0030.00316.93
8.0.260.0030.00316.88
8.0.250.0080.00016.98
8.0.240.0030.00317.14
8.0.230.0030.00616.95
8.0.220.0000.00716.91
8.0.210.0000.00717.08
8.0.200.0030.00616.93
8.0.190.0000.00716.95
8.0.180.0040.00417.09
8.0.170.0040.00416.88
8.0.160.0040.00416.89
8.0.150.0000.00716.92
8.0.140.0000.01116.78
8.0.130.0030.00313.42
8.0.120.0000.00816.95
8.0.110.0050.00316.98
8.0.100.0000.00817.07
8.0.90.0040.00417.04
8.0.80.0120.00816.96
8.0.70.0050.00216.80
8.0.60.0030.00516.96
8.0.50.0070.00016.89
8.0.30.0110.01017.13
8.0.20.0260.01017.41
8.0.10.0040.00417.03
8.0.00.0080.01216.74
7.4.330.0000.00515.03
7.4.320.0030.00316.68
7.4.300.0000.00716.60
7.4.290.0070.00016.64
7.4.280.0070.00016.55
7.4.270.0080.00016.56
7.4.260.0070.00016.49
7.4.250.0040.00416.60
7.4.240.0020.00516.66
7.4.230.0070.00016.53
7.4.220.0090.00916.57
7.4.210.0030.01216.70
7.4.200.0040.00416.45
7.4.160.0070.01016.69
7.4.150.0150.00617.40
7.4.140.0080.01117.86
7.4.130.0130.00716.58
7.4.120.0090.01116.52
7.4.110.0070.01016.54
7.4.100.0140.00816.59
7.4.90.0130.01016.82
7.4.80.0200.00319.39
7.4.70.0110.00616.69
7.4.60.0090.00916.77
7.4.50.0030.00516.21
7.4.40.0030.01416.70
7.4.30.0090.00916.70
7.4.10.0030.01715.00
7.4.00.0070.01015.06
7.3.330.0050.00013.36
7.3.320.0030.00313.27
7.3.310.0030.00316.39
7.3.300.0000.00716.43
7.3.290.0060.00816.44
7.3.280.0110.00716.39
7.3.270.0180.00917.40
7.3.260.0120.01216.70
7.3.250.0110.00716.45
7.3.240.0030.01316.43
7.3.230.0120.00916.46
7.3.210.0230.00016.41
7.3.200.0000.01616.37
7.3.190.0060.01016.68
7.3.180.0100.00716.35
7.3.170.0000.01616.63
7.3.160.0100.01216.44
7.3.130.0060.01215.17
7.3.120.0030.01514.90
7.3.110.0060.01115.17
7.3.100.0110.00315.06
7.3.90.0020.00914.90
7.3.80.0030.00614.91
7.3.70.0060.00814.86
7.3.60.0100.00414.68
7.3.50.0060.01014.90
7.3.40.0080.00515.05
7.3.30.0070.00714.93
7.3.20.0030.00816.65
7.3.10.0080.00516.62
7.3.00.0070.00716.72
7.2.330.0130.00716.81
7.2.320.0080.00816.48
7.2.310.0040.01516.84
7.2.300.0030.01316.38
7.2.290.0100.01316.43
7.2.260.0030.01715.38
7.2.250.0090.00615.10
7.2.240.0130.00314.85
7.2.230.0030.01215.18
7.2.220.0050.01115.34
7.2.210.0090.00415.07
7.2.200.0050.00715.04
7.2.190.0090.00714.95
7.2.180.0070.00915.01
7.2.170.0030.01215.30
7.2.160.0040.00415.09
7.2.150.0040.00716.92
7.2.140.0070.00716.69
7.2.130.0110.00316.72
7.2.120.0060.00616.96
7.2.110.0050.01016.97
7.2.100.0100.00617.00
7.2.90.0070.00816.97
7.2.80.0030.01116.95
7.2.70.0050.01216.88
7.2.60.0060.00516.93
7.2.50.0060.00616.85
7.2.40.0060.00917.02
7.2.30.0040.00816.94
7.2.20.0090.00716.74
7.2.10.0100.00516.82
7.2.00.0090.00617.82
7.1.330.0030.01115.96
7.1.320.0090.00815.86
7.1.310.0060.00315.86
7.1.300.0070.00815.83
7.1.290.0050.01115.77
7.1.280.0070.00615.88
7.1.270.0080.00515.77
7.1.260.0060.00615.92
7.1.250.0030.00915.78
7.1.240.0090.00315.94
7.1.230.0040.01115.86
7.1.220.0040.00415.54
7.1.210.0030.01215.84
7.1.200.0000.00916.02
7.1.190.0100.00315.91
7.1.180.0030.00515.88
7.1.170.0030.00515.79
7.1.160.0090.00315.90
7.1.150.0070.01015.77
7.1.140.0120.00315.79
7.1.130.0040.01215.61
7.1.120.0030.00715.91
7.1.110.0040.01115.95
7.1.100.0080.00816.85
7.1.90.0070.00715.65
7.1.80.0080.00415.88
7.1.70.0100.00516.49
7.1.60.0090.00817.64
7.1.50.0110.00816.31
7.1.40.0110.00316.00
7.1.30.0030.00715.68
7.1.20.0030.01015.79
7.1.10.0000.01215.45
7.1.00.0050.04018.99
7.0.330.0070.00715.43
7.0.320.0030.00615.45
7.0.310.0000.01315.36
7.0.300.0110.00315.30
7.0.290.0080.00815.35
7.0.280.0130.00315.34
7.0.270.0110.00415.07
7.0.260.0000.00915.30
7.0.250.0060.00915.39
7.0.240.0080.00615.50
7.0.230.0060.00615.61
7.0.220.0070.00715.20
7.0.210.0070.00715.48
7.0.200.0060.00715.38
7.0.190.0000.01415.57
7.0.180.0030.01015.45
7.0.170.0030.01015.44
7.0.160.0090.00015.53
7.0.150.0030.00715.43
7.0.140.0090.00615.46
7.0.130.0000.01115.32
7.0.120.0030.00915.54
7.0.110.0000.01215.32
7.0.100.0120.00015.42
7.0.90.0050.04317.70
7.0.80.0160.04117.73
7.0.70.0120.03217.66
7.0.60.0120.04217.77
7.0.50.0050.04417.97
7.0.40.0060.03516.72
7.0.30.0090.02916.83
7.0.20.0130.03916.70
7.0.10.0070.04116.77
7.0.00.0020.04716.76
5.6.400.0030.00614.61
5.6.390.0030.00714.26
5.6.380.0040.00414.78
5.6.370.0040.00414.33
5.6.360.0030.01114.32
5.6.350.0060.00614.34
5.6.340.0040.01214.76
5.6.330.0050.00514.21
5.6.320.0060.00614.53
5.6.310.0030.01314.74
5.6.300.0070.00714.53
5.6.290.0080.00414.36
5.6.280.0030.04217.71
5.6.270.0000.01414.73
5.6.260.0000.01114.36
5.6.250.0000.01414.43
5.6.240.0080.04517.41
5.6.230.0110.04317.59
5.6.220.0060.04417.60
5.6.210.0080.02817.53
5.6.200.0070.03217.73
5.6.190.0050.04317.67
5.6.180.0050.04817.76
5.6.170.0080.04517.55
5.6.160.0080.04317.81
5.6.150.0060.04017.77
5.6.140.0090.04117.80
5.6.130.0140.04117.82
5.6.120.0110.03817.85
5.6.110.0070.02817.80
5.6.100.0070.04217.77
5.6.90.0110.04117.81
5.6.80.0160.03617.30
5.6.70.0140.03417.38
5.6.60.0050.04517.42
5.6.50.0050.04017.42
5.6.40.0100.04017.30
5.6.30.0070.02517.53
5.6.20.0050.03217.48
5.6.10.0040.04717.46
5.6.00.0080.04117.36
5.5.380.0070.02817.45
5.5.370.0070.04417.50
5.5.360.0070.04317.42
5.5.350.0060.04517.42
5.5.340.0070.02717.73
5.5.330.0030.04817.69
5.5.320.0100.03317.51
5.5.310.0050.03217.52
5.5.300.0090.04217.49
5.5.290.0120.04217.81
5.5.280.0120.03217.72
5.5.270.0050.05117.67
5.5.260.0070.04217.57
5.5.250.0080.04517.24
5.5.240.0080.03717.37
5.5.230.0050.02717.29
5.5.220.0050.04217.26
5.5.210.0100.03817.41
5.5.200.0050.04517.40
5.5.190.0080.03517.16
5.5.180.0120.04217.19
5.5.170.0000.01014.05
5.5.160.0040.02917.22
5.5.150.0050.02417.41
5.5.140.0050.02517.41
5.5.130.0050.02317.13
5.5.120.0050.02517.11
5.5.110.0020.02717.14
5.5.100.0050.02317.30
5.5.90.0110.01817.05
5.5.80.0060.02717.23
5.5.70.0070.02117.23
5.5.60.0060.01817.24
5.5.50.0050.02217.03
5.5.40.0080.02017.26
5.5.30.0070.02217.26
5.5.20.0050.02417.22
5.5.10.0060.02317.15
5.5.00.0020.02617.28
5.4.450.0050.04415.81
5.4.440.0120.03515.84
5.4.430.0080.03915.82
5.4.420.0080.04015.80
5.4.410.0050.04015.75
5.4.400.0030.03015.65
5.4.390.0070.04015.59
5.4.380.0080.03315.70
5.4.370.0130.01315.59
5.4.360.0050.02015.57
5.4.350.0060.03315.63
5.4.340.0030.03815.65
5.4.330.0070.00312.24
5.4.320.0110.03715.74
5.4.310.0050.04015.63
5.4.300.0050.03015.73
5.4.290.0070.02015.59
5.4.280.0080.01815.59
5.4.270.0080.02015.64
5.4.260.0020.03215.66
5.4.250.0070.02315.51
5.4.240.0080.01615.65
5.4.230.0040.02215.64
5.4.220.0080.01815.63
5.4.210.0030.02115.69
5.4.200.0040.02115.52
5.4.190.0050.02115.64
5.4.180.0040.02215.67
5.4.170.0000.02415.66
5.4.160.0050.02215.62
5.4.150.0030.03615.65
5.4.140.0070.02514.17
5.4.130.0020.02614.29
5.4.120.0080.01814.24
5.4.110.0020.02214.30
5.4.100.0020.02214.33
5.4.90.0040.02314.29
5.4.80.0030.01814.28
5.4.70.0070.01514.29
5.4.60.0030.02614.22
5.4.50.0020.02314.21
5.4.40.0010.02414.24
5.4.30.0040.02114.33
5.4.20.0020.01914.22
5.4.10.0060.01514.22
5.4.00.0020.02013.99
5.3.290.0100.05314.49
5.3.280.0100.02714.56
5.3.270.0000.04014.52
5.3.260.0070.07014.61
5.3.250.0030.04014.44
5.3.240.0070.05014.57
5.3.230.0070.03014.59
5.3.220.0070.03314.41
5.3.210.0030.03714.41
5.3.200.0030.03714.55
5.3.190.0000.03314.42
5.3.180.0070.03314.43
5.3.170.0030.03714.53
5.3.160.0030.03014.38
5.3.150.0100.03014.50
5.3.140.0000.03714.52
5.3.130.0030.08014.42
5.3.120.0000.04314.51
5.3.110.0030.07014.46
5.3.100.0070.03014.04
5.3.90.0000.06013.84
5.3.80.0070.06714.00
5.3.70.0070.04013.88
5.3.60.0030.03314.00
5.3.50.0030.03713.80
5.3.40.0070.03313.81
5.3.30.0100.03013.89
5.3.20.0100.03013.66
5.3.10.0030.03313.64
5.3.00.0000.04013.65
5.2.170.0030.03010.96
5.2.160.0000.03011.20
5.2.150.0000.02710.96
5.2.140.0000.03011.21
5.2.130.0030.02711.10
5.2.120.0000.03011.16
5.2.110.0030.03311.03
5.2.100.0000.03011.07
5.2.90.0030.03010.97
5.2.80.0000.03011.14
5.2.70.0000.04311.16
5.2.60.0100.04010.98
5.2.50.0030.03010.95
5.2.40.0030.04710.85
5.2.30.0070.03310.97
5.2.20.0030.06710.91
5.2.10.0030.05010.91
5.2.00.0030.04010.62
5.1.60.0170.02010.02
5.1.50.0030.05310.08
5.1.40.0130.04010.02
5.1.30.0030.05010.39
5.1.20.0030.05010.41
5.1.10.0100.0409.92
5.1.00.0030.0479.91
5.0.50.0000.0338.63
5.0.40.0070.0138.29
5.0.30.0030.0378.27
5.0.20.0030.0438.26
5.0.10.0070.0308.02
5.0.00.0100.0578.16
4.4.90.0000.0237.77
4.4.80.0000.0207.77
4.4.70.0000.0307.77
4.4.60.0030.0237.77
4.4.50.0030.0307.77
4.4.40.0070.0337.77
4.4.30.0000.0407.77
4.4.20.0000.0407.77
4.4.10.0030.0237.77
4.4.00.0000.0277.77
4.3.110.0030.0337.77
4.3.100.0070.0177.77
4.3.90.0100.0207.77
4.3.80.0000.0537.77
4.3.70.0030.0307.77
4.3.60.0030.0307.77
4.3.50.0070.0337.77
4.3.40.0000.0537.77
4.3.30.0000.0307.77
4.3.20.0030.0307.77
4.3.10.0000.0307.77
4.3.00.0000.0237.77

preferences:
62.71 ms | 401 KiB | 5 Q