3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ApiException extends \Exception { public function __construct(string $message, int $code = 0, \Exception $previous = null) { parent::__construct($message, $code, $previous); } public function __toString() { return $this->getTraceAsString().': '.$this->message; } } function foo() { bar(); } function bar() { throw new ApiException('Please select a date between 1950 and 2050'); } try { foo(); } catch (Exception $e) { echo $e; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 4
Branch analysis from position: 4
2 jumps found. (Code = 107) Position 1 = 5, Position 2 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UHI08
function name:  (null)
number of ops:  7
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'apiexception', 'exception'
   26     1        INIT_FCALL                                               'foo'
          2        DO_FCALL                                      0          
          3      > JMP                                                      ->6
   27     4  E > > CATCH                                       last         'Exception'
   28     5    >   ECHO                                                     !0
   29     6    > > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UHI08
function name:  foo
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL_BY_NAME                                       'bar'
          1        DO_FCALL                                      0          
   19     2      > RETURN                                                   null

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/UHI08
function name:  bar
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $0      'ApiException'
          1        SEND_VAL_EX                                              'Please+select+a+date+between+1950+and+2050'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $0
   23     4*     > RETURN                                                   null

End of function bar

Class ApiException:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UHI08
function name:  __construct
number of ops:  9
compiled vars:  !0 = $message, !1 = $code, !2 = $previous
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      0
          2        RECV_INIT                                        !2      null
    7     3        INIT_STATIC_METHOD_CALL                                  
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !1
          6        SEND_VAR_EX                                              !2
          7        DO_FCALL                                      0          
    9     8      > 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/UHI08
function name:  __toString
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_METHOD_CALL                                         'getTraceAsString'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      $0, '%3A+'
          3        FETCH_OBJ_R                                      ~2      'message'
          4        CONCAT                                           ~3      ~1, ~2
          5        VERIFY_RETURN_TYPE                                       ~3
          6      > RETURN                                                   ~3
   14     7*       VERIFY_RETURN_TYPE                                       
          8*     > RETURN                                                   null

End of function __tostring

End of class ApiException.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.83 ms | 1407 KiB | 14 Q