online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
<?php function find_all_phrases($string) { $start = 0; while (($start = strpos($string, "[", $start)) !== false && ($end = strpos($string, "]", $start)) !== false) { if ($end - $start > 1) $positions[] = [$start, $end]; $start = $end++; } return $positions; } print_r(find_all_phrases("[1] [25] [99] [2521] []lorem [2]"));

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue