3v4l.org

run code in 300+ PHP versions simultaneously
<?php // fake function to simulate what a query with PDO::FETCH_COLUMN will return function returnWords(?PDO $pdo, string $category, int $limit): array { $words = []; for ($i = 0; $i < $limit; $i++) { $words[] = 'Word' . rand(1, 99); } return $words; } $pdo = null; $limit = 4; $categories = ['0', '33', '67']; $words_joined = ''; foreach ($categories as $category) { $words = returnWords($pdo, $category, $limit); $words_joined .= implode("\r\n", $words) . "\r\n"; } echo $words_joined;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 19
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 19
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/qqjgiD
function name:  (null)
number of ops:  22
compiled vars:  !0 = $pdo, !1 = $limit, !2 = $categories, !3 = $words_joined, !4 = $category, !5 = $words
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, null
   16     1        ASSIGN                                                   !1, 4
   17     2        ASSIGN                                                   !2, <array>
   20     3        ASSIGN                                                   !3, ''
   22     4      > FE_RESET_R                                       $10     !2, ->19
          5    > > FE_FETCH_R                                               $10, !4, ->19
   24     6    >   INIT_FCALL                                               'returnwords'
          7        SEND_VAR                                                 !0
          8        SEND_VAR                                                 !4
          9        SEND_VAR                                                 !1
         10        DO_FCALL                                      0  $11     
         11        ASSIGN                                                   !5, $11
   25    12        INIT_FCALL                                               'implode'
         13        SEND_VAL                                                 '%0D%0A'
         14        SEND_VAR                                                 !5
         15        DO_ICALL                                         $13     
         16        CONCAT                                           ~14     $13, '%0D%0A'
         17        ASSIGN_OP                                     8          !3, ~14
   22    18      > JMP                                                      ->5
         19    >   FE_FREE                                                  $10
   28    20        ECHO                                                     !3
   29    21      > RETURN                                                   1

Function returnwords:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 6
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 6
Branch analysis from position: 16
Branch analysis from position: 6
filename:       /in/qqjgiD
function name:  returnWords
number of ops:  20
compiled vars:  !0 = $pdo, !1 = $category, !2 = $limit, !3 = $words, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    6     3        ASSIGN                                                   !3, <array>
    7     4        ASSIGN                                                   !4, 0
          5      > JMP                                                      ->14
    9     6    >   INIT_FCALL                                               'rand'
          7        SEND_VAL                                                 1
          8        SEND_VAL                                                 99
          9        DO_ICALL                                         $8      
         10        CONCAT                                           ~9      'Word', $8
         11        ASSIGN_DIM                                               !3
         12        OP_DATA                                                  ~9
    7    13        PRE_INC                                                  !4
         14    >   IS_SMALLER                                               !4, !2
         15      > JMPNZ                                                    ~11, ->6
   12    16    >   VERIFY_RETURN_TYPE                                       !3
         17      > RETURN                                                   !3
   13    18*       VERIFY_RETURN_TYPE                                       
         19*     > RETURN                                                   null

End of function returnwords

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.51 ms | 1006 KiB | 16 Q