3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $b = 'some'; public function __toString() { return $this->b; } } $a = new A(); $array = (array)(string)$a; print_r($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RMqQH
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'a'
   11     1        NEW                                              $2      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   12     4        CAST                                          6  ~5      !0
          5        CAST                                          7  ~6      ~5
          6        ASSIGN                                                   !1, ~6
   14     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

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

End of function __tostring

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.81 ms | 1386 KiB | 15 Q