3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Wtf { public function __get($property) { \Fiber::suspend(); echo "hi " . $property . "\n"; } } $fibers[] = new \Fiber(function () { $wtf = new Wtf(); echo $wtf->a; }); $fibers[] = new \Fiber(function () { $wtf = new Wtf(); echo $wtf->b; }); while (\count($fibers) > 0) { foreach ($fibers as $key => $fiber) { if (!$fiber->isStarted()) { $fiber->start(); } elseif ($fiber->isSuspended()) { $fiber->resume(); } // If the Fiber hasn't terminated by this point, move onto the next // placeholder, we'll resume this Fiber again when we get back here. if (!$fiber->isTerminated()) { continue; } unset($fibers[$key]); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 13
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 35
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 35
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 23
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 33
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 33
Branch analysis from position: 32
Branch analysis from position: 33
Branch analysis from position: 28
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 13
Branch analysis from position: 39
Branch analysis from position: 13
Branch analysis from position: 35
filename:       /in/089uP
function name:  (null)
number of ops:  40
compiled vars:  !0 = $fibers, !1 = $fiber, !2 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   NEW                                                  $4      'Fiber'
          1        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
   17     2        SEND_VAL_EX                                                  ~5
   14     3        DO_FCALL                                          0          
          4        ASSIGN_DIM                                                   !0
   17     5        OP_DATA                                                      $4
   19     6        NEW                                                  $8      'Fiber'
          7        DECLARE_LAMBDA_FUNCTION                              ~9      [1]
   22     8        SEND_VAL_EX                                                  ~9
   19     9        DO_FCALL                                          0          
         10        ASSIGN_DIM                                                   !0
   22    11        OP_DATA                                                      $8
   25    12      > JMP                                                          ->36
   26    13    > > FE_RESET_R                                           $11     !0, ->35
         14    > > FE_FETCH_R                                           ~12     $11, !1, ->35
         15    >   ASSIGN                                                       !2, ~12
   27    16        INIT_METHOD_CALL                                             !1, 'isStarted'
         17        DO_FCALL                                          0  $14     
         18        BOOL_NOT                                             ~15     $14
         19      > JMPZ                                                         ~15, ->23
   28    20    >   INIT_METHOD_CALL                                             !1, 'start'
         21        DO_FCALL                                          0          
   27    22      > JMP                                                          ->28
   30    23    >   INIT_METHOD_CALL                                             !1, 'isSuspended'
         24        DO_FCALL                                          0  $17     
         25      > JMPZ                                                         $17, ->28
   31    26    >   INIT_METHOD_CALL                                             !1, 'resume'
         27        DO_FCALL                                          0          
   35    28    >   INIT_METHOD_CALL                                             !1, 'isTerminated'
         29        DO_FCALL                                          0  $19     
         30        BOOL_NOT                                             ~20     $19
         31      > JMPZ                                                         ~20, ->33
   36    32    > > JMP                                                          ->14
   38    33    >   UNSET_DIM                                                    !0, !2
   26    34      > JMP                                                          ->14
         35    >   FE_FREE                                                      $11
   25    36    >   COUNT                                                ~21     !0
         37        IS_SMALLER                                                   0, ~21
         38      > JMPNZ                                                        ~22, ->13
   40    39    > > 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/089uP
function name:  {closure:/in/089uP:14}
number of ops:  6
compiled vars:  !0 = $wtf
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   NEW                                                  $1      'Wtf'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   16     3        FETCH_OBJ_R                                          ~4      !0, 'a'
          4        ECHO                                                         ~4
   17     5      > RETURN                                                       null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/089uP
function name:  {closure:/in/089uP:19}
number of ops:  6
compiled vars:  !0 = $wtf
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   NEW                                                  $1      'Wtf'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   21     3        FETCH_OBJ_R                                          ~4      !0, 'b'
          4        ECHO                                                         ~4
   22     5      > RETURN                                                       null

End of Dynamic Function 1

Class Wtf:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/089uP
function name:  __get
number of ops:  7
compiled vars:  !0 = $property
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
    7     1        INIT_STATIC_METHOD_CALL                                      'Fiber', 'suspend'
          2        DO_FCALL                                          0          
    8     3        CONCAT                                               ~2      'hi+', !0
          4        CONCAT                                               ~3      ~2, '%0A'
          5        ECHO                                                         ~3
    9     6      > RETURN                                                       null

End of function __get

End of class Wtf.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.43 ms | 1510 KiB | 13 Q