File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2741,6 +2741,34 @@ static function (&$value) use ($encoding): void {
27412741 return $ array ;
27422742 }
27432743
2744+ /**
2745+ * Dumps the strings using the given function (print_r by default).
2746+ *
2747+ * @param callable $callback Function receiving the strings as parameter.
2748+ *
2749+ * @return self Returns instance of The Strings class.
2750+ */
2751+ public function dump (?callable $ callback = null ): self
2752+ {
2753+ $ callback ? $ callback ($ this ->strings ) : print_r ($ this ->items );
2754+
2755+ return $ this ;
2756+ }
2757+
2758+ /**
2759+ * Dumps the string using the given function (print_r by default) and exit(1).
2760+ *
2761+ * @param callable $callback Function receiving the strings as parameter.
2762+ *
2763+ * @return void Return void.
2764+ */
2765+ public function dd (?callable $ callback = null ): void
2766+ {
2767+ $ this ->dump ($ callback );
2768+
2769+ exit (1 );
2770+ }
2771+
27442772 /**
27452773 * Returns a new ArrayIterator, thus implementing the IteratorAggregate
27462774 * interface. The ArrayIterator's constructor is passed an array of chars
You can’t perform that action at this time.
0 commit comments