3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Stapler { protected $color; public function __construct($color) { $this->color = $color; } public function staple($paper1, $paper2) { echo "the ".$this->color." stapler, staples ".$paper1.' '.$paper2.' together'; } } $redStapler = new Stapler('red'); $blackStapler = new Stapler('black'); $redStapler->staple('cat', 'dog'); echo "\n"; $blackStapler->staple('sign', 'tree');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QNmQ0
function name:  (null)
number of ops:  18
compiled vars:  !0 = $redStapler, !1 = $blackStapler
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'Stapler'
          1        SEND_VAL_EX                                              'red'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   16     4        NEW                                              $5      'Stapler'
          5        SEND_VAL_EX                                              'black'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   18     8        INIT_METHOD_CALL                                         !0, 'staple'
          9        SEND_VAL_EX                                              'cat'
         10        SEND_VAL_EX                                              'dog'
         11        DO_FCALL                                      0          
   19    12        ECHO                                                     '%0A'
   20    13        INIT_METHOD_CALL                                         !1, 'staple'
         14        SEND_VAL_EX                                              'sign'
         15        SEND_VAL_EX                                              'tree'
         16        DO_FCALL                                      0          
         17      > RETURN                                                   1

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

End of function __construct

Function staple:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QNmQ0
function name:  staple
number of ops:  11
compiled vars:  !0 = $paper1, !1 = $paper2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        FETCH_OBJ_R                                      ~2      'color'
          3        CONCAT                                           ~3      'the+', ~2
          4        CONCAT                                           ~4      ~3, '+stapler%2C+staples+'
          5        CONCAT                                           ~5      ~4, !0
          6        CONCAT                                           ~6      ~5, '+'
          7        CONCAT                                           ~7      ~6, !1
          8        CONCAT                                           ~8      ~7, '+together'
          9        ECHO                                                     ~8
   12    10      > RETURN                                                   null

End of function staple

End of class Stapler.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.4 ms | 1395 KiB | 13 Q