Can i 'hijack some code' from php?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sims

    Can i 'hijack some code' from php?

    Hi.

    Is it possible to 'subclass' php the same way you can subclass c++

    a simple example would be...

    // CODE

    <?

    function print( $txt )
    {
    $txt = "[add something]".txt;
    // pass it top php
    php::print( $txt ); // <========= How could that be done?
    }

    print( 'this is a test' );

    ?>
    // CODE

    Is something like that possible?

    Many thanks


  • Chung Leong

    #2
    Re: Can i 'hijack some code' from php?

    Nope.

    Uzytkownik "Sims" <siminfrance@ho tmail.com> napisal w wiadomosci
    news:c0l79u$187 pu3$1@ID-162430.news.uni-berlin.de...[color=blue]
    > Hi.
    >
    > Is it possible to 'subclass' php the same way you can subclass c++
    >
    > a simple example would be...
    >
    > // CODE
    >
    > <?
    >
    > function print( $txt )
    > {
    > $txt = "[add something]".txt;
    > // pass it top php
    > php::print( $txt ); // <========= How could that be done?
    > }
    >
    > print( 'this is a test' );
    >
    > ?>
    > // CODE
    >
    > Is something like that possible?
    >
    > Many thanks
    >
    >[/color]


    Comment

    • Phil Roberts

      #3
      Re: Can i 'hijack some code' from php?

      With total disregard for any kind of safety measures "Sims"
      <siminfrance@ho tmail.com> leapt forth and uttered:
      [color=blue]
      > Is something like that possible?
      >
      > Many thanks[/color]

      PHP does not support namespaces so doing what you suggested is not
      possible. You can do something similar if you define a class
      however.

      class PHP {
      function method() {

      }
      }

      PHP::method();


      --
      Phil Roberts | Nobody In Particular | http://www.flatnet.net/

      Comment

      Working...