ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Php syntax : thinking outsite of the box

February 21, 2008 4:20am

Subscribe [2]
  • #1 / Feb 21, 2008 4:20am

    xwero

    4145 posts

    What have html, xml and php in common? The fact that they use the less than and greater than characters for parsing in the same manner. < starts the parsing, > stops the parsing. Why is it not the other way around?

    php> // read php starts here
    
    // all your amazing code
    
    php< // read php ends here

    If you look at javascript and ruby they add functions to the end of variables but they are inconsistent with branching and loops. To create consistency for all program language functionality moves after the changeable portion.

    php>
    
        $array as $item foreach>
            $array2>< = $item strtolower><;
        foreach<
    
    php<

     
    As you can see no more curly/square/round brackets and functions are smart enough to know which variable they have to manipulate.

    Et voila php3000 is born!

  • #2 / Feb 21, 2008 4:57am

    Crimp

    320 posts

    Why is CI still supporting PHP2999?! 😠

  • #3 / Feb 21, 2008 7:55am

    Phil Sturgeon

    2889 posts

    We are just moving towards ECMAScript, lets not start buggering em up more eh?

    A good way to get away from those bastard curly brackets is to use the Alternative PHP Syntax, which uses if(): endif;, which works for which, foreach, for, switch, if and try.

  • #4 / Feb 21, 2008 9:30am

    xwero

    4145 posts

    I have to say i like the python syntax for it’s indentation. Because you have to do it you write more readable code from the start. Based on python including php in html would be something like

    <body>
    <ul>
    php
        $array as $item foreach
            <li>$item</li>
    
    </ul>
    </body>

    Echo is gone in php3000 😊 The language should be smart enough to check if it’s included in other code (echo) or not (return). But then you also should use at least three lines for simply echoing a variable. So the alternative syntax for including php is

    <ul>php> $array as $item foreach> <li>$item</li> php<</ul>

    If you go out the php parsing you don’t have to define the loop end.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases