aboutsummaryrefslogtreecommitdiffhomepage
path: root/catchline.php
diff options
context:
space:
mode:
Diffstat (limited to 'catchline.php')
-rw-r--r--catchline.php62
1 files changed, 62 insertions, 0 deletions
diff --git a/catchline.php b/catchline.php
new file mode 100644
index 0000000..058abeb
--- /dev/null
+++ b/catchline.php
@@ -0,0 +1,62 @@
+<?php
+try {
+ f(3);
+} catch (Throwable $e) {
+ while ($e = $e->getPrevious()) printf('%c', $e->getLine() + 23);
+ echo "\n";
+}
+function f(int $i) {
+ if ($i < 0) f();
+ try {
+ match ($i) {
+ 0 => X, // 12行目
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 => X, // 49行目
+
+
+
+
+
+
+
+ 1, 3 => X, // 57行目
+ };
+ } finally {
+ f($i - 1);
+ }
+}