This topic was marked solved by its starter, on March 24th, 2013, 10:32 PM
Initializing the Wedge templating magic

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Initializing the Wedge templating magic
« 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?
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Initializing the Wedge templating magic
« Reply #1, 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.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Initializing the Wedge templating magic
« Reply #2, 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!