3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isCorrect($string) { if (strlen($string) % 2 === 0) { for( $i = 0; $i < strlen($string); $i++) { $string; } return true; } return false; } $string = '({{}})'; //var_dump(isCorrect($string)); var_dump(strlen($string) % 2); //assert(isCorrect('') === true); //assert(isCorrect('()') === true); //assert(isCorrect('{()}') === true); //assert(isCorrect('{()}{}') === true); //assert(isCorrect('(())') === true); //assert(isCorrect('{({({({()})})})}') === true); //assert(isCorrect('{(})') === false);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EvJdJ
function name:  (null)
number of ops:  7
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, '%28%7B%7B%7D%7D%29'
   13     1        INIT_FCALL                                               'var_dump'
          2        STRLEN                                           ~2      !0
          3        MOD                                              ~3      ~2, 2
          4        SEND_VAL                                                 ~3
          5        DO_ICALL                                                 
   21     6      > RETURN                                                   1

Function iscorrect:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 7
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 7
Branch analysis from position: 11
Branch analysis from position: 7
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EvJdJ
function name:  isCorrect
number of ops:  14
compiled vars:  !0 = $string, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        STRLEN                                           ~2      !0
          2        MOD                                              ~3      ~2, 2
          3        IS_IDENTICAL                                             ~3, 0
          4      > JMPZ                                                     ~4, ->12
    4     5    >   ASSIGN                                                   !1, 0
          6      > JMP                                                      ->8
          7    >   PRE_INC                                                  !1
          8    >   STRLEN                                           ~7      !0
          9        IS_SMALLER                                               !1, ~7
         10      > JMPNZ                                                    ~8, ->7
    7    11    > > RETURN                                                   <true>
    9    12    > > RETURN                                                   <false>
   10    13*     > RETURN                                                   null

End of function iscorrect

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.61 ms | 1387 KiB | 15 Q