3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $x; private $y; public function __construct() { $this->x = 10; $this->y = function (){ return $this->getToutesLesCommandes();}; } public function __get($k) { return $this->$k; } public function getToutesLesCommandes() { //sleep(5); echo "Et 5 tres longues secondes plus tard..."; return array('commande1' => 123456, 'commande2' => 456789); } } $t = new Test(); //var_dump($t); echo $t->y; var_dump($t->y);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VQ57o
function name:  (null)
number of ops:  10
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   30     3        FETCH_OBJ_R                                      ~4      !0, 'y'
          4        ECHO                                                     ~4
   31     5        INIT_FCALL                                               'var_dump'
          6        FETCH_OBJ_R                                      ~5      !0, 'y'
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FVQ57o%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VQ57o
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_THIS                                       $0      
          1        INIT_METHOD_CALL                                         $0, 'getToutesLesCommandes'
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
          4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FVQ57o%3A11%240

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VQ57o
function name:  __construct
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN_OBJ                                               'x'
          1        OP_DATA                                                  10
   11     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FVQ57o%3A11%240'
          3        ASSIGN_OBJ                                               'y'
          4        OP_DATA                                                  ~2
   12     5      > RETURN                                                   null

End of function __construct

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VQ57o
function name:  __get
number of ops:  4
compiled vars:  !0 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   16     1        FETCH_OBJ_R                                      ~1      !0
          2      > RETURN                                                   ~1
   17     3*     > RETURN                                                   null

End of function __get

Function gettouteslescommandes:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VQ57o
function name:  getToutesLesCommandes
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   ECHO                                                     'Et+5+tres+longues+secondes+plus+tard...'
   23     1      > RETURN                                                   <array>
   24     2*     > RETURN                                                   null

End of function gettouteslescommandes

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.56 ms | 1400 KiB | 15 Q