3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Text { protected $text; public function __construct(string $text) { $this->text = $text; } public function __toString(): string { return $this->text; } public function get(): string { return $this->text; } } class Say { public function greet(string $name) { echo "Hello {$name}!"; } } $bob = new Text('Bob'); $say = new Say(); $say->greet($bob);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XK0rb
function name:  (null)
number of ops:  12
compiled vars:  !0 = $bob, !1 = $say
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'text'
   25     1        NEW                                              $2      'Text'
          2        SEND_VAL_EX                                              'Bob'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   26     5        NEW                                              $5      'Say'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   28     8        INIT_METHOD_CALL                                         !1, 'greet'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Class Text:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XK0rb
function name:  __construct
number of ops:  4
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSIGN_OBJ                                               'text'
          2        OP_DATA                                                  !0
    8     3      > 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/XK0rb
function name:  __toString
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_R                                      ~0      'text'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   12     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function __tostring

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

End of function get

End of class Text.

Class Say:
Function greet:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XK0rb
function name:  greet
number of ops:  6
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        ROPE_INIT                                     3  ~2      'Hello+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%21'
          4        ECHO                                                     ~1
   22     5      > RETURN                                                   null

End of function greet

End of class Say.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.82 ms | 1399 KiB | 13 Q