3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function __toString() { try { throw new \Exception("hello?"); } catch (\Exception $e) { return ":("; } } } echo new A();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MgJhS
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'a'
   15     1        NEW                                              $0      'A'
          2        DO_FCALL                                      0          
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Class A:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MgJhS
function name:  __toString
number of ops:  9
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $1      'Exception'
          1        SEND_VAL_EX                                              'hello%3F'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $1
          4*       JMP                                                      ->7
    9     5  E > > CATCH                                       last         'Exception'
   10     6    > > RETURN                                                   '%3A%28'
   12     7*       VERIFY_RETURN_TYPE                                       
          8*     > RETURN                                                   null

End of function __tostring

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.36 ms | 1394 KiB | 13 Q