3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = '{"data":[{"contactid":"21405","startdate":"2016-01-25 00:00:00","workingdays":"1.00","staff_email":"lee@unu.edu","staff_department":"Procurement & Administration Unit - KL","staff_name":"Angela LEE","enddate":"2016-01-25 00:00:00"},{"contactid":"21405","startdate":"2016-02-01 00:00:00","workingdays":"1.00","staff_email":"lee@unu.edu","staff_department":"Procurement & Administration Unit - KL","staff_name":"Angela LEE","enddate":"2016-02-01 00:00:00"}]} '; $json = json_decode($content); print_r($json); $dates = ""; //$away_dates = ''; for ($i=0; $i< count($json); $i++) { $dates .= $json->data[$i]->startdate. ", "; } echo $dates;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 11
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 11
Branch analysis from position: 20
Branch analysis from position: 11
filename:       /in/XdJIN
function name:  (null)
number of ops:  22
compiled vars:  !0 = $content, !1 = $json, !2 = $dates, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%22data%22%3A%5B%7B%22contactid%22%3A%2221405%22%2C%22startdate%22%3A%222016-01-25+00%3A00%3A00%22%2C%22workingdays%22%3A%221.00%22%2C%22staff_email%22%3A%22lee%40unu.edu%22%2C%22staff_department%22%3A%22Procurement+%26+Administration+Unit+-+KL%22%2C%22staff_name%22%3A%22Angela+LEE%22%2C%22enddate%22%3A%222016-01-25+00%3A00%3A00%22%7D%2C%7B%22contactid%22%3A%2221405%22%2C%22startdate%22%3A%222016-02-01+00%3A00%3A00%22%2C%22workingdays%22%3A%221.00%22%2C%22staff_email%22%3A%22lee%40unu.edu%22%2C%22staff_department%22%3A%22Procurement+%26+Administration+Unit+-+KL%22%2C%22staff_name%22%3A%22Angela+LEE%22%2C%22enddate%22%3A%222016-02-01+00%3A00%3A00%22%7D%5D%7D+'
    5     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    7     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
    8     8        ASSIGN                                                   !2, ''
   10     9        ASSIGN                                                   !3, 0
         10      > JMP                                                      ->17
   13    11    >   FETCH_OBJ_R                                      ~10     !1, 'data'
         12        FETCH_DIM_R                                      ~11     ~10, !3
         13        FETCH_OBJ_R                                      ~12     ~11, 'startdate'
         14        CONCAT                                           ~13     ~12, '%2C+'
         15        ASSIGN_OP                                     8          !2, ~13
   10    16        PRE_INC                                                  !3
         17    >   COUNT                                            ~16     !1
         18        IS_SMALLER                                               !3, ~16
         19      > JMPNZ                                                    ~17, ->11
   16    20    >   ECHO                                                     !2
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.61 ms | 1396 KiB | 17 Q