3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Test; class Test { private $s; private $i; public function __construct(string $s, int $i) { $this->s = $s; $this->i = $i; } public function foo() { return $this->s . ' ' . $this->i; } } $a = new Test('', '0'); echo $a->foo();
based on COh9V
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/BI9JH
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   NOP                                                      
  21     1        NEW                                              $2      :-6
         2        SEND_VAL_EX                                              ''
         3        SEND_VAL_EX                                              '0'
         4        DO_FCALL                                      0          
         5        ASSIGN                                                   !0, $2
  22     6        INIT_METHOD_CALL                                         !0, 'foo'
         7        DO_FCALL                                      0  $5      
         8        ECHO                                                     $5
         9      > RETURN                                                   1

Class Test\Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/BI9JH
function name:  __construct
number of ops:  7
compiled vars:  !0 = $s, !1 = $i
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  10     0  E >   RECV                                             !0      
         1        RECV                                             !1      
  11     2        ASSIGN_OBJ                                               's'
         3        OP_DATA                                                  !0
  12     4        ASSIGN_OBJ                                               'i'
         5        OP_DATA                                                  !1
  13     6      > RETURN                                                   null

End of function __construct

Function foo:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/BI9JH
function name:  foo
number of ops:  6
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  17     0  E >   FETCH_OBJ_R                                      $0      's'
         1        CONCAT                                           ~1      $0, '+'
         2        FETCH_OBJ_R                                      $2      'i'
         3        CONCAT                                           ~3      ~1, $2
         4      > RETURN                                                   ~3
  18     5*     > RETURN                                                   null

End of function foo

End of class Test\Test.

Generated using Vulcan Logic Dumper, using php 7.3.0