3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SerialDateTime extends DateTime implements JsonSerializable{ public function jsonSerialize(){ return ['timestamp' => $this->getTimestamp()]; } public static function createFromFormat(){ $a = call_user_func_array(array(__CLASS__ , 'parent::'.__METHOD__), func_get_args()); return new self($a->getTimestamp()); } } echo json_encode([SerialDateTime::createFromFormat('m/d/Y', '10/31/2011')]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K4GNm
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'serialdatetime', 'datetime'
   15     1        INIT_FCALL                                               'json_encode'
          2        INIT_STATIC_METHOD_CALL                                  'SerialDateTime', 'createFromFormat'
          3        SEND_VAL_EX                                              'm%2Fd%2FY'
          4        SEND_VAL_EX                                              '10%2F31%2F2011'
          5        DO_FCALL                                      0  $0      
          6        INIT_ARRAY                                       ~1      $0
          7        SEND_VAL                                                 ~1
          8        DO_ICALL                                         $2      
          9        ECHO                                                     $2
         10      > RETURN                                                   1

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

End of function jsonserialize

Function createfromformat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K4GNm
function name:  createFromFormat
number of ops:  13
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_USER_CALL                                0          'call_user_func_array', <array>
          1        FUNC_GET_ARGS                                    ~1      
          2        SEND_ARRAY                                               ~1
          3        CHECK_UNDEF_ARGS                                         
          4        DO_FCALL                                      0  $2      
          5        ASSIGN                                                   !0, $2
   11     6        NEW                          self                $4      
          7        INIT_METHOD_CALL                                         !0, 'getTimestamp'
          8        DO_FCALL                                      0  $5      
          9        SEND_VAR_NO_REF_EX                                       $5
         10        DO_FCALL                                      0          
         11      > RETURN                                                   $4
   12    12*     > RETURN                                                   null

End of function createfromformat

End of class SerialDateTime.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.04 ms | 1396 KiB | 15 Q