Wedge

Public area => Bug reports => The Pub => Archived fixes => Topic started by: live627 on March 23rd, 2013, 11:41 PM

Title: Initializing the Wedge templating magic
Post by: live627 on March 23rd, 2013, 11:41 PM
In Load.php,  I see $context['skeleton'] = '';, when it is used as an array.

Siidenote: Can PHP force type strictness?
Title: Re: Initializing the Wedge templating magic
Post by: Arantor on March 23rd, 2013, 11:47 PM
That's probably a bug then :/

Type 'strictness' is an interesting concept in PHP. Officially, it's type loose, all the time implied casting (coercing) can occur, e.g. comparing numbers and strings implicitly works (which is why you can put numbers into strcmp and get answers). As soon as you cannot do a viable casting, then no.

That really comes into play with objects, where if you try to work on an object, it'll go through properties, __get and will implicitly try to involve toString() where applicable - and if it can't be coerced to a string, it'll then throw a type error.
Title: Re: Initializing the Wedge templating magic
Post by: Nao on March 24th, 2013, 12:04 PM
Yes, PHP is a loose type language. So it doesn't matter per se.

Still, you're right John, skeletons are now an array at this stage. The '' initialization code was added in rev 997, in the first implementation of the skeleton system, back when it was a string to be parsed. Now it's done before anything else, and $context['skeleton'] holds a list of parsed mini-skeletons.

As such, I modified the declaration to reflect this. Thanks!