3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new DateTime(); $json = json_encode(array('a' => $a)); var_dump($a); $b = json_decode($json, true)['a']; var_dump(DateTime::__set_state($b));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eqs2s
function name:  (null)
number of ops:  24
compiled vars:  !0 = $a, !1 = $json, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'DateTime'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    5     3        INIT_FCALL                                               'json_encode'
          4        INIT_ARRAY                                       ~6      !0, 'a'
          5        SEND_VAL                                                 ~6
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !1, $7
    7     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
    9    11        INIT_FCALL                                               'json_decode'
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $10     
         15        FETCH_DIM_R                                      ~11     $10, 'a'
         16        ASSIGN                                                   !2, ~11
   11    17        INIT_FCALL                                               'var_dump'
         18        INIT_STATIC_METHOD_CALL                                  'DateTime', '__set_state'
         19        SEND_VAR                                                 !2
         20        DO_FCALL                                      0  $13     
         21        SEND_VAR                                                 $13
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.67 ms | 1399 KiB | 19 Q