A PHP Error was encountered

Severity: 8192

Message: Optional parameter $prod_file declared before required parameter $minify is implicitly treated as a required parameter

Filename: libraries/Carabiner.php

Line Number: 464

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 10
Function: __construct

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_database_driver::open($save_path, $name) should either be compatible with SessionHandlerInterface::open(string $path, string $name): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_database_driver.php

Line Number: 129

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_database_driver::close() should either be compatible with SessionHandlerInterface::close(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_database_driver.php

Line Number: 280

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_database_driver::read($session_id) should either be compatible with SessionHandlerInterface::read(string $id): string|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_database_driver.php

Line Number: 151

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_database_driver::write($session_id, $session_data) should either be compatible with SessionHandlerInterface::write(string $id, string $data): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_database_driver.php

Line Number: 208

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_database_driver::destroy($session_id) should either be compatible with SessionHandlerInterface::destroy(string $id): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_database_driver.php

Line Number: 297

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_database_driver::gc($maxlifetime) should either be compatible with SessionHandlerInterface::gc(int $max_lifetime): int|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_database_driver.php

Line Number: 335

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 282

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_set_cookie_params(): Session cookie parameters cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 294

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 304

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 314

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 315

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 316

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 317

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 375

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_set_save_handler(): Session save handler cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 110

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_start(): Session cannot be started after headers have already been sent

Filename: Session/Session.php

Line Number: 143

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: stristr(): Passing null to parameter #1 ($haystack) of type string is deprecated

Filename: controllers/Main.php

Line Number: 229

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 229
Function: stristr

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: stristr(): Passing null to parameter #1 ($haystack) of type string is deprecated

Filename: controllers/Main.php

Line Number: 251

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 251
Function: stristr

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: stristr(): Passing null to parameter #1 ($haystack) of type string is deprecated

Filename: controllers/Main.php

Line Number: 269

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 269
Function: stristr

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: filter_var(): Passing null to parameter #3 ($options) of type array|int is deprecated

Filename: core/Input.php

Line Number: 572

Backtrace:

File: /home/paste/public_html/application/models/Pastes.php
Line: 522
Function: ip_address

File: /home/paste/public_html/application/controllers/Main.php
Line: 592
Function: getPaste

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

Tuple duple - Paste.ie - an Irish pastebin
From Asbjørn, 8 Years ago, written in Delphi (Object Pascal).
Embed
  1. program TupleTest;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. uses
  6.   System.SysUtils;
  7.  
  8. type
  9.   IgnoreElm = record end;
  10.  
  11.   Tuple<T1, T2> = record
  12.   {$REGION 'Implementation details'}
  13.   private
  14.     type
  15.       P1 = ^T1;
  16.       P2 = ^T2;
  17.       Tier = record
  18.         Ref1: P1;
  19.         Ref2: P2;
  20.  
  21.         class operator LessThanOrEqual(const Dest: Tier; const Src: Tuple<T1, T2>): boolean; overload;
  22.       end;
  23.   private
  24.     class operator Implicit(const Value: Tuple<T1, T2>): Tuple<T1, IgnoreElm>;
  25.     class operator Implicit(const Value: Tuple<T1, T2>): Tuple<IgnoreElm, T2>;
  26.   {$ENDREGION}
  27.   public
  28.     Elm1: T1;
  29.     Elm2: T2;
  30.   end;
  31.  
  32.   Tuple = record
  33.   public
  34.     class function From<T1, T2>(const Value1: T1; Value2: T2): Tuple<T1, T2>; static;
  35.     class function Tie<T1, T2>(var Elm1: T1; var Elm2: T2): Tuple<T1, T2>.Tier; overload; static;
  36.     class function Tie<T1>(var Elm1: T1; const Ignored2: IgnoreElm): Tuple<T1, IgnoreElm>.Tier; overload; static;
  37.     class function Tie<T2>(const Ignored1: IgnoreElm; var Elm2: T2): Tuple<IgnoreElm, T2>.Tier; overload; static;
  38.   end;
  39.  
  40. const
  41.   Ignore: IgnoreElm = ();
  42.  
  43. procedure Test;
  44. var
  45.   tup: Tuple<integer, string>;
  46.   i: integer;
  47.   s: string;
  48. begin
  49.   i := 123;
  50.   s := 'bar';
  51.  
  52.   tup := Tuple.From<integer, string>(42, 'foo');
  53.  
  54.   Tuple.Tie(Ignore, s) <= tup;
  55.  
  56.   WriteLn(i, ', ', s);  // 123, foo
  57. end;
  58.  
  59. { Tuple }
  60.  
  61. class function Tuple.From<T1, T2>(const Value1: T1; Value2: T2): Tuple<T1, T2>;
  62. begin
  63.   result.Elm1 := Value1;
  64.   result.Elm2 := Value2;
  65. end;
  66.  
  67. class function Tuple.Tie<T1, T2>(var Elm1: T1; var Elm2: T2): Tuple<T1, T2>.Tier;
  68. begin
  69.   result.Ref1 := @Elm1;
  70.   result.Ref2 := @Elm2;
  71. end;
  72.  
  73. class function Tuple.Tie<T1>(var Elm1: T1;
  74.   const Ignored2: IgnoreElm): Tuple<T1, IgnoreElm>.Tier;
  75. begin
  76.   result.Ref1 := @Elm1;
  77.   result.Ref2 := nil;
  78. end;
  79.  
  80. class function Tuple.Tie<T2>(const Ignored1: IgnoreElm;
  81.   var Elm2: T2): Tuple<IgnoreElm, T2>.Tier;
  82. begin
  83.   result.Ref1 := nil;
  84.   result.Ref2 := @Elm2;
  85. end;
  86.  
  87. { Tuple<T1, T2>.Tier }
  88.  
  89. class operator Tuple<T1, T2>.Tier.LessThanOrEqual(const Dest: Tier;
  90.   const Src: Tuple<T1, T2>): boolean;
  91. begin
  92.   if (TypeInfo(T1) <> TypeInfo(IgnoreElm)) then
  93.     Dest.Ref1^ := Src.Elm1;
  94.   if (TypeInfo(T2) <> TypeInfo(IgnoreElm)) then
  95.     Dest.Ref2^ := Src.Elm2;
  96.   result := True;
  97. end;
  98.  
  99. { Tuple<T1, T2> }
  100.  
  101. class operator Tuple<T1, T2>.Implicit(
  102.   const Value: Tuple<T1, T2>): Tuple<T1, IgnoreElm>;
  103. begin
  104.   result.Elm1 := Value.Elm1;
  105. end;
  106.  
  107. class operator Tuple<T1, T2>.Implicit(
  108.   const Value: Tuple<T1, T2>): Tuple<IgnoreElm, T2>;
  109. begin
  110.   result.Elm2 := Value.Elm2;
  111. end;
  112.  
  113. begin
  114.   Test;
  115.   ReadLn;
  116. end.
  117.