- str_split: documentation ( source)
<?php
class R {
public $digit;
function __construct($digit) { $this->digit = $digit; }
function __destruct() { echo "$digit"; }
}
function rev($number) {
foreach (str_split($number) as $digit) {
$objs[] = new R($digit);
}
}
rev(13457);