3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Animal { private $name = "No-name animal"; public function __construct($name) { echo "I'm alive!\n"; $this->name = $name; } public function test(){ echo "Name of the animal: " . $this->name ."\n"; } public function __destruct() { echo "I'm dead now :(\n"; } } $animal = new Animal("Bob"); $animal=null; $animal2=new Animal("cat"); $animal2->test(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2cv4e
function name:  (null)
number of ops:  12
compiled vars:  !0 = $animal, !1 = $animal2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $2      'Animal'
          1        SEND_VAL_EX                                              'Bob'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   20     4        ASSIGN                                                   !0, null
   21     5        NEW                                              $6      'Animal'
          6        SEND_VAL_EX                                              'cat'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $6
   22     9        INIT_METHOD_CALL                                         !1, 'test'
         10        DO_FCALL                                      0          
   23    11      > RETURN                                                   1

Class Animal:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2cv4e
function name:  __construct
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ECHO                                                     'I%27m+alive%21%0A'
    8     2        ASSIGN_OBJ                                               'name'
          3        OP_DATA                                                  !0
   10     4      > RETURN                                                   null

End of function __construct

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2cv4e
function name:  test
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      'name'
          1        CONCAT                                           ~1      'Name+of+the+animal%3A+', ~0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
   13     4      > RETURN                                                   null

End of function test

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2cv4e
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'I%27m+dead+now+%3A%28%0A'
   17     1      > RETURN                                                   null

End of function __destruct

End of class Animal.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.6 ms | 1395 KiB | 13 Q