A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Untitled - Stikked
From Round Human, 12 Years ago, written in Python.
Embed
  1. # You can copy'n'paste this whole shit into the interactive interpreter!
  2.  
  3. data = {
  4.         "name1": "value1",
  5.         "name2": "value2"
  6.         }
  7. # Old code:
  8. result1 = "%s %s" % (data["name1"], data["name2"])
  9. # New code:
  10. result2 = "%(name1)s %(name2)s" % data
  11. # Advantages:
  12. # - You don't have to worry about the order of the arguments
  13. # - You don't have to refer 'data' everytime
  14. # Disadvantage:
  15. # - If your argument isn't in the dict, you have to do sth like this:
  16. "%(ood)s %(name1)s" % ({"ood": "Not in the dict"} + data)
  17. # or you have to add it to the dict first.
  18.  
  19. # Alternative using str.format and dict unpacking (recommended over old-style formatting):
  20. result3 = "{name1} {name2}".format(**data)
  21. # All results are the same
  22.  
  23. # --------------------------
  24. # String concatenation:
  25. str1 = "Hello Aha"
  26. str2 = "Hello " + "Aha" # Explicit usage of + (not recommended)
  27. str3 = "Hello " "Aha" # Implicit concatanation of string literals
  28. str4 = "Hello "\
  29. "Aha" # Over multiple lines, newline escaped (not recommended since a space after the backslash would break it)
  30. str5 = "".join(("Hello ", "Aha")) # Joining of a tuple, not neccessary (see method 6)
  31. str6 = ("Hello "
  32.         "Aha") # Preferred method, note that you're not building a tuple here (no comma)
  33. # All strings are the same