3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '[ {"recipient_name":"John D", "phone_number":"123456"}, {"recipient_name":"Doe J", "phone_number":"654321"}, {"recipient_name":"Jon Do", "phone_number":"112233"} ]'; $myLargerArray = json_decode($json, true); $myObjArray = (object) ['message_recipients' => array()]; $size = count($myLargerArray); $myObjArray->message_recipients = []; for ($j = 0; $j < $size; $j++) { $myRecipientsObj = new stdClass; $myRecipientsObj->recipient_name = $myLargerArray[$j]['recipient_name']; $myRecipientsObj->phone_number = $myLargerArray[$j]['phone_number']; // var_dump($myRecipientsObj); // This outputs the correct data added from [$j] $myObjArray->message_recipients[] = $myRecipientsObj; } var_dump($myObjArray->message_recipients); // The output shows array elements are being overwritten at each loop iteration

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.0040.01118.31
8.3.50.0100.00716.54
8.3.40.0100.01018.79
8.3.30.0120.00318.81
8.3.20.0050.00320.85
8.3.10.0040.00418.98
8.3.00.0070.00021.85
8.2.180.0140.00725.92
8.2.170.0180.00318.94
8.2.160.0100.00322.96
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0070.00726.16
8.2.120.0040.00426.16
8.2.110.0030.00721.05
8.2.100.0030.00719.14
8.2.90.0090.00017.97
8.2.80.0050.00317.97
8.2.70.0040.00418.00
8.2.60.0050.00318.22
8.2.50.0040.00419.47
8.2.40.0000.00919.35
8.2.30.0030.00519.20
8.2.20.0060.00318.18
8.2.10.0000.00718.93
8.2.00.0030.00319.54
8.1.280.0100.00725.92
8.1.270.0050.00320.88
8.1.260.0030.00626.35
8.1.250.0080.00028.09
8.1.240.0090.00922.48
8.1.230.0070.00422.68
8.1.220.0030.00617.74
8.1.210.0000.00818.77
8.1.200.0030.00617.34
8.1.190.0030.00617.35
8.1.180.0050.00318.10
8.1.170.0080.00018.52
8.1.160.0000.00718.96
8.1.150.0030.00518.81
8.1.140.0000.00720.18
8.1.130.0000.00720.18
8.1.120.0000.00717.48
8.1.110.0040.00417.48
8.1.100.0000.00717.36
8.1.90.0040.00417.54
8.1.80.0000.00717.44
8.1.70.0040.00417.48
8.1.60.0040.00417.60
8.1.50.0030.00617.45
8.1.40.0060.00317.53
8.1.30.0040.00417.67
8.1.20.0000.00817.61
8.1.10.0080.00017.52
8.1.00.0000.00817.45
8.0.300.0070.00019.77
8.0.290.0040.00416.75
8.0.280.0050.00218.29
8.0.270.0000.00816.82
8.0.260.0050.00318.45
8.0.250.0000.00716.95
8.0.240.0070.00016.95
8.0.230.0040.00417.00
8.0.220.0030.00716.79
8.0.210.0030.00416.89
8.0.200.0000.00716.89
8.0.190.0050.00316.85
8.0.180.0080.00016.83
8.0.170.0030.00617.00
8.0.160.0030.00516.99
8.0.150.0050.00316.92
8.0.140.0040.00416.96
8.0.130.0030.00313.40
8.0.120.0000.00816.89
8.0.110.0050.00317.01
8.0.100.0040.00416.95
8.0.90.0030.00316.96
8.0.80.0080.00816.89
8.0.70.0070.00016.86
8.0.60.0040.00417.01
8.0.50.0040.00417.00
8.0.30.0110.00817.20
8.0.20.0060.01417.04
8.0.10.0040.00417.00
8.0.00.0150.00616.80
7.4.330.0000.00615.55
7.4.320.0030.00316.60
7.4.300.0030.00316.65
7.4.290.0000.00816.52
7.4.280.0000.00716.42
7.4.270.0070.00016.65
7.4.260.0070.00016.58
7.4.250.0000.00716.40
7.4.240.0000.00816.59
7.4.230.0000.00716.71
7.4.220.0000.00816.62
7.4.210.0050.01016.61
7.4.200.0030.00316.51
7.4.160.0070.01216.50
7.4.130.0160.00616.40
7.4.120.0120.00816.64
7.4.110.0060.00916.52
7.4.100.0070.01016.55
7.4.90.0060.01216.49
7.4.80.0110.00519.39
7.4.70.0060.01216.42
7.4.60.0100.01216.49
7.4.50.0100.00716.46
7.4.40.0130.00316.51
7.4.30.0070.00916.47
7.4.20.0100.00816.47
7.4.10.0090.01016.49
7.4.00.0050.01215.72
7.3.330.0030.00313.23
7.3.320.0030.00313.24
7.3.310.0040.00416.44
7.3.300.0070.00016.36
7.3.290.0170.00016.38
7.3.280.0090.01116.39
7.3.260.0090.00916.48
7.3.230.0130.00316.42
7.3.210.0200.00016.39
7.3.200.0090.01616.29
7.3.190.0060.01016.50
7.3.180.0090.00916.52
7.3.170.0080.00816.44
7.3.160.0090.00716.36
7.3.150.0110.00716.30
7.3.140.0070.01516.43
7.3.130.0060.01316.40
7.3.120.0080.00915.92
7.3.110.0080.00815.82
7.3.100.0070.01115.85
7.3.90.0100.00615.87
7.3.80.0070.01215.92
7.3.70.0020.01215.89
7.3.60.0080.00715.71
7.3.50.0100.00715.57
7.3.40.0080.00815.48
7.3.30.0090.00915.56
7.3.20.0070.01016.55
7.3.10.0100.00616.52
7.3.00.0170.00716.44
7.2.330.0150.00616.73
7.2.320.0120.01216.37
7.2.310.0090.00816.71
7.2.300.0110.00616.45
7.2.290.0110.00516.75
7.2.280.0100.00816.53
7.2.270.0070.01516.61
7.2.260.0170.00616.65
7.2.250.0100.00916.21
7.2.240.0050.01216.30
7.2.230.0070.01016.02
7.2.220.0060.01116.00
7.2.210.0040.01315.96
7.2.200.0070.00916.08
7.2.190.0100.00716.03
7.2.180.0060.01215.76
7.2.170.0100.00815.85
7.2.160.0060.01016.04
7.2.150.0090.00916.75
7.2.140.0070.00916.57
7.2.130.0050.01016.70
7.2.120.0070.01116.67
7.2.110.0050.01216.59
7.2.100.0070.00916.74
7.2.90.0100.01116.83
7.2.80.0130.00916.67
7.2.70.0110.00716.58
7.2.60.0080.01016.70
7.2.50.0130.00616.79
7.2.40.0130.00716.76
7.2.30.0130.00716.76
7.2.20.0070.01016.81
7.2.10.0110.00716.68
7.2.00.0130.00716.69
7.1.330.0340.00815.75
7.1.320.0080.01215.30
7.1.310.0100.00615.52
7.1.300.0110.01015.45
7.1.290.0120.00715.52
7.1.280.0090.00815.64
7.1.270.0130.00615.71
7.1.260.0070.00915.54
7.1.250.0130.00415.53
7.1.240.0320.00615.43
7.1.230.0140.00915.45
7.1.220.0100.00815.35
7.1.210.0210.00915.41
7.1.200.0110.01115.31
7.1.190.0170.00215.53
7.1.180.0140.00515.41
7.1.170.0290.00015.35
7.1.160.0130.00715.43
7.1.150.0130.00615.54
7.1.140.0160.00615.28
7.1.130.0120.01215.47
7.1.120.0140.00615.46
7.1.110.0170.00615.37
7.1.100.0110.01015.34
7.1.90.0170.00515.44
7.1.80.0230.01015.12
7.1.70.0110.01115.41
7.1.60.0100.00915.23
7.1.50.0080.01315.27
7.1.40.0120.00715.39
7.1.30.0070.01415.20
7.1.20.0130.00815.25
7.1.10.0050.01315.56
7.1.00.0120.00515.28
7.0.330.0120.01215.05
7.0.320.0230.00615.34
7.0.310.0180.01115.19
7.0.300.0140.01114.96
7.0.290.0210.00615.11
7.0.280.0220.00315.27
7.0.270.0110.00815.05
7.0.260.0220.00515.04
7.0.250.0240.00715.21
7.0.240.0210.00715.02
7.0.230.0320.00615.18
7.0.220.0150.01115.16
7.0.210.0210.00915.39
7.0.200.0190.01015.17
7.0.190.0180.01215.26
7.0.180.0150.00715.23
7.0.170.0140.00715.37
7.0.160.0270.00015.32
7.0.150.0250.00315.27
7.0.140.0220.01015.24
7.0.130.0110.01515.26
7.0.120.0460.00915.35
7.0.110.0270.00015.33
7.0.100.0220.00715.11
7.0.90.0270.00315.21
7.0.80.0210.00915.23
7.0.70.0320.01015.10
7.0.60.0160.01015.18
7.0.50.0210.00615.11
7.0.40.0160.01014.97
7.0.30.0170.01115.18
7.0.20.0140.01715.17
7.0.10.0190.01415.22
7.0.00.0240.00315.21
5.6.400.0180.00916.28
5.6.390.0190.00816.17
5.6.380.0250.00716.01
5.6.370.0200.01016.30
5.6.360.0140.01115.70
5.6.350.0160.01016.05
5.6.340.0130.01616.04
5.6.330.0160.01316.05
5.6.320.0200.01216.20
5.6.310.0250.00916.18
5.6.300.0230.01016.26
5.6.290.0170.01116.01
5.6.280.0160.01316.12
5.6.270.0230.01016.30
5.6.260.0110.01615.89
5.6.250.0220.00416.09
5.6.240.0150.01516.09
5.6.230.0170.01416.12
5.6.220.0240.00815.88
5.6.210.0240.00916.07
5.6.200.0230.01016.05
5.6.190.0150.01215.75
5.6.180.0180.01116.03
5.6.170.0210.01415.99
5.6.160.0260.00916.15
5.6.150.0330.00915.99
5.6.140.0220.01416.03
5.6.130.0190.01015.88
5.6.120.0260.00716.14
5.6.110.0250.00416.05
5.6.100.0180.01115.98
5.6.90.0140.01615.95
5.6.80.0100.01715.98
5.6.70.0180.01115.84
5.6.60.0210.00916.10
5.6.50.0220.00616.06
5.6.40.0210.00716.00
5.6.30.0170.01116.10
5.6.20.0210.00815.97
5.6.10.0190.01016.02
5.6.00.0190.01015.90
5.5.380.0190.01016.04
5.5.370.0080.02415.96
5.5.360.0180.00916.18
5.5.350.0160.01116.13
5.5.340.0230.00515.95
5.5.330.0190.00915.78
5.5.320.0230.00915.99
5.5.310.0180.01016.05
5.5.300.0110.01816.09
5.5.290.0170.01315.86
5.5.280.0240.00716.12
5.5.270.0190.01016.07
5.5.260.0190.00915.89
5.5.250.0220.00715.79
5.5.240.0200.01215.91
5.5.230.0220.00616.14
5.5.220.0130.01615.97
5.5.210.0150.01115.96
5.5.200.0210.00715.93
5.5.190.0150.01216.01
5.5.180.0270.00315.86
5.5.170.0250.00415.95
5.5.160.0160.01315.83
5.5.150.0120.01715.78
5.5.140.0180.00915.84
5.5.130.0230.00716.04
5.5.120.0170.01015.95
5.5.110.0220.00616.00
5.5.100.0180.01215.84
5.5.90.0130.02016.00
5.5.80.0250.00315.71
5.5.70.0150.01116.05
5.5.60.0210.00616.21
5.5.50.0180.00915.84
5.5.40.0220.00615.88
5.5.30.0240.00316.07
5.5.20.0120.01515.96
5.5.10.0170.01216.19
5.5.00.0160.01615.90
5.4.450.0120.00412.63
5.4.440.0220.00412.52
5.4.430.0100.01112.64
5.4.420.0150.00712.54
5.4.410.0130.01312.81
5.4.400.0230.00312.57
5.4.390.0180.00412.74
5.4.380.0190.00512.70
5.4.370.0180.00712.66
5.4.360.0110.01112.61
5.4.350.0130.00912.62
5.4.340.0120.00912.63
5.4.330.0060.01712.59
5.4.320.0170.00412.61
5.4.310.0100.01012.80
5.4.300.0120.01212.80
5.4.290.0170.00912.57
5.4.280.0170.00712.63
5.4.270.0080.01312.71
5.4.260.0150.01612.64
5.4.250.0140.00712.69
5.4.240.0120.00912.79
5.4.230.0110.01012.55
5.4.220.0170.00712.59
5.4.210.0160.00512.68
5.4.200.0150.00912.55
5.4.190.0120.00812.63
5.4.180.0230.00012.75
5.4.170.0240.00012.57
5.4.160.0190.00612.71
5.4.150.0120.00912.78
5.4.140.0170.00612.74
5.4.130.0180.00412.61
5.4.120.0150.00712.71
5.4.110.0160.00612.85
5.4.100.0200.00812.66
5.4.90.0140.00912.68
5.4.80.0140.00612.66
5.4.70.0160.00612.71
5.4.60.0150.00512.71
5.4.50.0140.01012.71
5.4.40.0080.01312.61
5.4.30.0150.00612.81
5.4.20.0170.00612.72
5.4.10.0100.01012.60
5.4.00.0180.00412.86
5.3.290.0170.00713.01
5.3.280.0100.01312.63
5.3.270.0130.00912.83
5.3.260.0200.00312.64
5.3.250.0170.01212.64
5.3.240.0150.00812.57
5.3.230.0070.01512.59
5.3.220.0110.01212.59
5.3.210.0190.00312.63
5.3.200.0220.00512.59
5.3.190.0120.00912.85
5.3.180.0120.00912.86
5.3.170.0100.01012.86
5.3.160.0220.00612.86
5.3.150.0150.00712.86
5.3.140.0090.01413.01
5.3.130.0130.00912.77
5.3.120.0070.01412.73
5.3.110.0180.00612.72
5.3.100.0120.01212.66
5.3.90.0150.00612.77
5.3.80.0150.00612.83
5.3.70.0110.01112.70
5.3.60.0180.00312.82
5.3.50.0130.00812.76
5.3.40.0220.00012.92
5.3.30.0220.00412.61
5.3.20.0090.01312.66
5.3.10.0140.01112.48
5.3.00.0130.01012.43
5.2.170.0070.01011.78
5.2.160.0130.00611.78
5.2.150.0050.01611.79
5.2.140.0130.00611.79
5.2.130.0060.01211.86
5.2.120.0110.00611.82
5.2.110.0040.01311.75
5.2.100.0080.01211.72
5.2.90.0070.01111.80
5.2.80.0080.01111.80
5.2.70.0160.00611.80
5.2.60.0080.00911.64
5.2.50.0100.00711.71
5.2.40.0130.00311.65
5.2.30.0060.01411.64
5.2.20.0120.00611.49
5.2.10.0160.00311.62
5.2.00.0090.00911.38
5.1.60.0110.00510.92
5.1.50.0060.01010.92
5.1.40.0150.00011.03
5.1.30.0130.00310.96
5.1.20.0060.00910.96
5.1.10.0060.00910.93
5.1.00.0120.00310.92
5.0.50.0070.00710.92
5.0.40.0030.00910.92
5.0.30.0100.00610.92
5.0.20.0000.01410.92
5.0.10.0100.00310.92
5.0.00.0090.00310.92
4.4.90.0070.00310.92
4.4.80.0040.00410.92
4.4.70.0050.00510.92
4.4.60.0100.00010.92
4.4.50.0060.00310.92
4.4.40.0030.00610.92
4.4.30.0040.00410.92
4.4.20.0080.00010.92
4.4.10.0060.00310.92
4.4.00.0040.00410.92
4.3.110.0050.00310.92
4.3.100.0090.00010.92
4.3.90.0060.00310.92
4.3.80.0090.00010.92
4.3.70.0070.00210.92
4.3.60.0060.00310.92
4.3.50.0070.00410.92
4.3.40.0060.00210.92
4.3.30.0070.00010.92
4.3.20.0060.00310.92
4.3.10.0000.00710.92
4.3.00.0040.00410.92

preferences:
36.11 ms | 401 KiB | 5 Q