3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo{ public $var; public function set(?int $value){ $this->var = $value; } } $foo = new Foo(); $foo->set(null); var_dump($foo); $foo->set(1); var_dump($foo); $foo->set(); var_dump($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n3FrG
function name:  (null)
number of ops:  21
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   12     3        INIT_METHOD_CALL                                         !0, 'set'
          4        SEND_VAL_EX                                              null
          5        DO_FCALL                                      0          
   13     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   14     9        INIT_METHOD_CALL                                         !0, 'set'
         10        SEND_VAL_EX                                              1
         11        DO_FCALL                                      0          
   15    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
   16    15        INIT_METHOD_CALL                                         !0, 'set'
         16        DO_FCALL                                      0          
   17    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

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

End of function set

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.01 ms | 1395 KiB | 15 Q