3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $name; public $action; public function __construct($name){ $this->name = $name; } public function action($action){ $this->action = $action; throw new Exception('destroyer ?'); } public function __destruct(){ echo "i'm dying".$this->name." ".$this->action; } } $o = new Test('o'); $p = new Test('p'); try { $o->action('first'); } catch(Exception $ex){ echo $ex->getMessage(); } $o->action('second');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 12
Branch analysis from position: 12
2 jumps found. (Code = 107) Position 1 = 13, Position 2 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oukH7
function name:  (null)
number of ops:  20
compiled vars:  !0 = $o, !1 = $p, !2 = $ex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $3      'Test'
          1        SEND_VAL_EX                                              'o'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
   18     4        NEW                                              $6      'Test'
          5        SEND_VAL_EX                                              'p'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   20     8        INIT_METHOD_CALL                                         !0, 'action'
          9        SEND_VAL_EX                                              'first'
         10        DO_FCALL                                      0          
         11      > JMP                                                      ->16
   21    12  E > > CATCH                                       last         'Exception'
   22    13    >   INIT_METHOD_CALL                                         !2, 'getMessage'
         14        DO_FCALL                                      0  $10     
         15        ECHO                                                     $10
   24    16    >   INIT_METHOD_CALL                                         !0, 'action'
         17        SEND_VAL_EX                                              'second'
         18        DO_FCALL                                      0          
         19      > RETURN                                                   1

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

End of function __construct

Function action:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/oukH7
function name:  action
number of ops:  8
compiled vars:  !0 = $action
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        ASSIGN_OBJ                                               'action'
          2        OP_DATA                                                  !0
   11     3        NEW                                              $2      'Exception'
          4        SEND_VAL_EX                                              'destroyer+%3F'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $2
   12     7*     > RETURN                                                   null

End of function action

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oukH7
function name:  __destruct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'name'
          1        CONCAT                                           ~1      'i%27m+dying', ~0
          2        CONCAT                                           ~2      ~1, '+'
          3        FETCH_OBJ_R                                      ~3      'action'
          4        CONCAT                                           ~4      ~2, ~3
          5        ECHO                                                     ~4
   15     6      > RETURN                                                   null

End of function __destruct

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.84 ms | 1399 KiB | 13 Q