3v4l.org

run code in 300+ PHP versions simultaneously
<?php $samples = [ "test1", "(test2", "test3)", "(test4)" ]; foreach ($samples as $sample) { if (strlen(trim($sample, "()")) !== strlen($sample)) { echo "found: ".$sample.PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 15
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/9DFBD
function name:  (null)
number of ops:  17
compiled vars:  !0 = $samples, !1 = $sample
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1      > FE_RESET_R                                       $3      !0, ->15
          2    > > FE_FETCH_R                                               $3, !1, ->15
   10     3    >   INIT_FCALL                                               'trim'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 '%28%29'
          6        DO_ICALL                                         $4      
          7        STRLEN                                           ~5      $4
          8        STRLEN                                           ~6      !1
          9        IS_NOT_IDENTICAL                                         ~5, ~6
         10      > JMPZ                                                     ~7, ->14
   11    11    >   CONCAT                                           ~8      'found%3A+', !1
         12        CONCAT                                           ~9      ~8, '%0A'
         13        ECHO                                                     ~9
    9    14    > > JMP                                                      ->2
         15    >   FE_FREE                                                  $3
   13    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.24 ms | 1010 KiB | 14 Q