3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php final class Foo { private $foo; public function __construct(string $foo) { $this->foo = $foo; } public function getFoo(): string { return $this->foo; } } $foo = new Foo('bar'); var_dump($foo->getFoo()); $foo->__construct('baz'); var_dump($foo->getFoo());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hHHvL
function name:  (null)
number of ops:  19
compiled vars:  !0 = $foo
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  18     1        NEW                                              $2      :31
         2        SEND_VAL_EX                                              'bar'
         3        DO_FCALL                                      0          
         4        ASSIGN                                                   !0, $2
  19     5        INIT_FCALL                                               'var_dump'
         6        INIT_METHOD_CALL                                         !0, 'getFoo'
         7        DO_FCALL                                      0  $5      
         8        SEND_VAR                                                 $5
         9        DO_ICALL                                                 
  21    10        INIT_METHOD_CALL                                         !0, '__construct'
        11        SEND_VAL_EX                                              'baz'
        12        DO_FCALL                                      0          
  22    13        INIT_FCALL                                               'var_dump'
        14        INIT_METHOD_CALL                                         !0, 'getFoo'
        15        DO_FCALL                                      0  $8      
        16        SEND_VAR                                                 $8
        17        DO_ICALL                                                 
        18      > RETURN                                                   1

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

End of function __construct

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

End of function getfoo

End of class Foo.

Generated using Vulcan Logic Dumper, using php 7.3.0