3v4l.org

run code in 500+ PHP versions simultaneously
<?php function checkEvenOrOdd() { $value = yield; yield ($value % 2 === 0) ? "Even: $value" : "Odd: $value"; } $evenOddChecker = checkEvenOrOdd(); echo $evenOddChecker->send(7). PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/I7AQN
function name:  (null)
number of ops:  9
compiled vars:  !0 = $evenOddChecker
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                                   'checkevenorodd'
          1        DO_FCALL                                          0  $1      
          2        ASSIGN                                                       !0, $1
   11     3        INIT_METHOD_CALL                                             !0, 'send'
          4        SEND_VAL_EX                                                  7
          5        DO_FCALL                                          0  $3      
          6        CONCAT                                               ~4      $3, '%0A'
          7        ECHO                                                         ~4
   12     8      > RETURN                                                       1

Function checkevenorodd:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/I7AQN
function name:  checkEvenOrOdd
number of ops:  15
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                             
    4     1        YIELD                                                $1      
          2        ASSIGN                                                       !0, $1
    6     3        MOD                                                  ~3      !0, 2
          4        IS_IDENTICAL                                                 ~3, 0
          5      > JMPZ                                                         ~4, ->10
          6    >   NOP                                                          
          7        FAST_CONCAT                                          ~5      'Even%3A+', !0
          8        QM_ASSIGN                                            ~6      ~5
          9      > JMP                                                          ->13
         10    >   NOP                                                          
         11        FAST_CONCAT                                          ~7      'Odd%3A+', !0
         12        QM_ASSIGN                                            ~6      ~7
         13    >   YIELD                                                        ~6
    7    14      > GENERATOR_RETURN                                             

End of function checkevenorodd

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.01 ms | 1468 KiB | 14 Q