3v4l.org

run code in 300+ PHP versions simultaneously
<?php class str { private $str; public function __construct($str){ $this->str = $str; } public function __tostring() { $this->this_ref = $this; return $this->str; } } array_fill_keys([new str("123")], true);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZOEju
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'str'
    9     1        INIT_FCALL                                               'array_fill_keys'
          2        NEW                                              $0      'str'
          3        SEND_VAL_EX                                              '123'
          4        DO_FCALL                                      0          
          5        INIT_ARRAY                                       ~2      $0
          6        SEND_VAL                                                 ~2
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

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

End of function __construct

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZOEju
function name:  __tostring
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_THIS                                       ~1      
          1        ASSIGN_OBJ                                               'this_ref'
          2        OP_DATA                                                  ~1
          3        FETCH_OBJ_R                                      ~2      'str'
          4        VERIFY_RETURN_TYPE                                       ~2
          5      > RETURN                                                   ~2
          6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function __tostring

End of class str.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.33 ms | 1395 KiB | 15 Q