3v4l.org

run code in 300+ PHP versions simultaneously
<?php $users = array(array('name' => 'a'), array('name' => 'b'), array('name' => 'c'), array('name' => 'd'), array('name' => 'e'), array('name' => 'f'), array('name' => 'g') ); function userNames($users) { foreach($users as $user) { yield $user['name']; } } $start = microtime(true) . PHP_EOL; foreach(userNames($users) as $name) { echo $name . PHP_EOL; } echo microtime(true) - $start;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/qjvFQ
function name:  (null)
number of ops:  21
compiled vars:  !0 = $users, !1 = $start, !2 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   20     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $4      
          4        CONCAT                                           ~5      $4, '%0A'
          5        ASSIGN                                                   !1, ~5
   22     6        INIT_FCALL                                               'usernames'
          7        SEND_VAR                                                 !0
          8        DO_FCALL                                      0  $7      
          9      > FE_RESET_R                                       $8      $7, ->14
         10    > > FE_FETCH_R                                               $8, !2, ->14
   24    11    >   CONCAT                                           ~9      !2, '%0A'
         12        ECHO                                                     ~9
   22    13      > JMP                                                      ->10
         14    >   FE_FREE                                                  $8
   27    15        INIT_FCALL                                               'microtime'
         16        SEND_VAL                                                 <true>
         17        DO_ICALL                                         $10     
         18        SUB                                              ~11     $10, !1
         19        ECHO                                                     ~11
         20      > RETURN                                                   1

Function usernames:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 7
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 7
filename:       /in/qjvFQ
function name:  userNames
number of ops:  9
compiled vars:  !0 = $users, !1 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
   14     2      > FE_RESET_R                                       $2      !0, ->7
          3    > > FE_FETCH_R                                               $2, !1, ->7
   16     4    >   FETCH_DIM_R                                      ~3      !1, 'name'
          5        YIELD                                                    ~3
   14     6      > JMP                                                      ->3
          7    >   FE_FREE                                                  $2
   18     8      > GENERATOR_RETURN                                         

End of function usernames

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.63 ms | 1399 KiB | 16 Q