3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Immutable { private $super_secret = 5; } $immutable = new Immutable(); var_dump($immutable); $immutable = (function () { $this->super_secret = 10; return $this; })->call($immutable); var_dump($immutable);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/smE9M
function name:  (null)
number of ops:  15
compiled vars:  !0 = $immutable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $1      'Immutable'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    7     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
    9     6        DECLARE_LAMBDA_FUNCTION                          ~5      [0]
   12     7        INIT_METHOD_CALL                                         ~5, 'call'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $6      
    9    10        ASSIGN                                                   !0, $6
   13    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
         14      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/smE9M
function name:  {closure}
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_THIS                                       $0      
          1        ASSIGN_OBJ                                               $0, 'super_secret'
          2        OP_DATA                                                  10
   11     3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
   12     5*     > RETURN                                                   null

End of Dynamic Function 0

Class Immutable: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.99 ms | 1010 KiB | 14 Q