3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SerialDateTime extends DateTime implements JsonSerializable{ public function jsonSerialize(){ return $this->getTimestamp(); } } $x = SerialDateTime::createFromFormat('m', 4); $y = new SerialDateTime; echo json_encode([$x,$y]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D8jIG
function name:  (null)
number of ops:  16
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'serialdatetime', 'datetime'
    9     1        INIT_STATIC_METHOD_CALL                                  'SerialDateTime', 'createFromFormat'
          2        SEND_VAL_EX                                              'm'
          3        SEND_VAL_EX                                              4
          4        DO_FCALL                                      0  $2      
          5        ASSIGN                                                   !0, $2
   10     6        NEW                                              $4      'SerialDateTime'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $4
   12     9        INIT_FCALL                                               'json_encode'
         10        INIT_ARRAY                                       ~7      !0
         11        ADD_ARRAY_ELEMENT                                ~7      !1
         12        SEND_VAL                                                 ~7
         13        DO_ICALL                                         $8      
         14        ECHO                                                     $8
         15      > RETURN                                                   1

Class SerialDateTime:
Function jsonserialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D8jIG
function name:  jsonSerialize
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_METHOD_CALL                                         'getTimestamp'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
    6     3*     > RETURN                                                   null

End of function jsonserialize

End of class SerialDateTime.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.95 ms | 1395 KiB | 15 Q