3v4l.org

run code in 300+ PHP versions simultaneously
<?php class StringValue implements JsonSerializable { public function __construct($string) { $this->string = (string) $string; } public function jsonSerialize() { return $this; } } echo json_encode(new StringValue('Hello!'), JSON_PRETTY_PRINT);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1WuTJ
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'stringvalue'
   13     1        INIT_FCALL                                               'json_encode'
          2        NEW                                              $0      'StringValue'
          3        SEND_VAL_EX                                              'Hello%21'
          4        DO_FCALL                                      0          
          5        SEND_VAR                                                 $0
          6        SEND_VAL                                                 128
          7        DO_ICALL                                         $2      
          8        ECHO                                                     $2
          9      > RETURN                                                   1

Class StringValue:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1WuTJ
function name:  __construct
number of ops:  5
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        CAST                                          6  ~2      !0
          2        ASSIGN_OBJ                                               'string'
          3        OP_DATA                                                  ~2
    6     4      > RETURN                                                   null

End of function __construct

Function jsonserialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1WuTJ
function name:  jsonSerialize
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_THIS                                       ~0      
          1      > RETURN                                                   ~0
   10     2*     > RETURN                                                   null

End of function jsonserialize

End of class StringValue.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.17 ms | 1395 KiB | 15 Q