3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = 'charanjeet/working/with/php'; echo strrpos($foo, '/', -5); echo (bool)strrpos($foo, '/', -5); //Answer: 18 => It will start searching it reverse direction after ignoring 5 five characters. //It will then return the position of the / after working, from the beginning charanjeet/working/ gạch / ở vị trí 18
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XqQbO
function name:  (null)
number of ops:  15
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'charanjeet%2Fworking%2Fwith%2Fphp'
    6     1        INIT_FCALL                                               'strrpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%2F'
          4        SEND_VAL                                                 -5
          5        DO_ICALL                                         $2      
          6        ECHO                                                     $2
    8     7        INIT_FCALL                                               'strrpos'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 '%2F'
         10        SEND_VAL                                                 -5
         11        DO_ICALL                                         $3      
         12        BOOL                                             ~4      $3
         13        ECHO                                                     ~4
   11    14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.28 ms | 1394 KiB | 15 Q