Hi!
> 1. Converting from A to B:
>
> $a = 123;
> $b = (Number) $a; // $b is now instanceof Number
>
> A instanceof Number will created based on $a value.
What's wrong with new Number(123)?
> 2. Reduce object type (I don't know the technical term):
>
> class A {}
> class B extends A {}
>
> $b = new B;
> $a = (A) $b;
>
> $a still is $b, but with "limited" access to A methods and properties.
Not sure why would you want to do this? What's the use case?
--
Stas Malyshev
[email protected]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php